Merge branch 'develop' of bitbucket.org:jamkazam/jam-cloud into develop
This commit is contained in:
commit
28ebbe893c
|
|
@ -92,10 +92,8 @@
|
|||
.done(function(response) {
|
||||
|
||||
if(!sessionInfo.mount) {
|
||||
if (sessionInfo.session_removed_at) {
|
||||
transition(PlayStateSessionOver);
|
||||
destroy();
|
||||
}
|
||||
transition(PlayStateSessionOver);
|
||||
destroy();
|
||||
}
|
||||
else {
|
||||
try {
|
||||
|
|
@ -122,7 +120,7 @@
|
|||
}
|
||||
}
|
||||
catch (err) {
|
||||
console.log("Catching error = %o", err);
|
||||
logger.log("Catching error = %o", err);
|
||||
}
|
||||
}
|
||||
})
|
||||
|
|
@ -147,7 +145,7 @@
|
|||
recreateAudioElement();
|
||||
}
|
||||
catch (err) {
|
||||
console.log("Catching error = %o", err);
|
||||
logger.log("Catching error = %o", err);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -160,7 +158,7 @@
|
|||
recreateAudioElement();
|
||||
}
|
||||
catch (err) {
|
||||
console.log("Catching error = %o", err);
|
||||
logger.log("Catching error = %o", err);
|
||||
}
|
||||
// destroyed = true;
|
||||
//}
|
||||
|
|
@ -173,14 +171,21 @@
|
|||
}
|
||||
|
||||
function createAudioElementHtml() {
|
||||
if (sessionInfo == null) throw "no session info";
|
||||
if (sessionInfo.mount == null) throw "no session mount info";
|
||||
if (sessionInfo == null) {
|
||||
logger.log("no session info");
|
||||
throw "no session info";
|
||||
}
|
||||
|
||||
if (sessionInfo.mount == null) {
|
||||
logger.log("no session mount info");
|
||||
throw "no session mount info";
|
||||
}
|
||||
|
||||
$audio =
|
||||
$('<audio preload="none">' +
|
||||
'<source src="' + cacheBustedSrc(sessionInfo.mount.url) + '" type="' + sessionInfo.mount.mime_type + '"/>' +
|
||||
'</audio>')
|
||||
$parent.append($audio)
|
||||
'</audio>');
|
||||
$parent.append($audio);
|
||||
audioDomElement = $audio.get(0);
|
||||
audioBind();
|
||||
|
||||
|
|
@ -265,10 +270,8 @@
|
|||
.done(function(response) {
|
||||
|
||||
if(!sessionInfo.mount) {
|
||||
if (sessionInfo.session_removed_at) {
|
||||
transition(PlayStateSessionOver);
|
||||
destroy();
|
||||
}
|
||||
transition(PlayStateSessionOver);
|
||||
destroy();
|
||||
}
|
||||
else {
|
||||
// tell audio to stop/start, in attempt to retry
|
||||
|
|
@ -292,7 +295,7 @@
|
|||
waitForBufferingTimeout = setTimeout(noBuffer, WAIT_FOR_BUFFER_TIMEOUT);
|
||||
}
|
||||
catch (err) {
|
||||
console.log("Catching error = %o", err);
|
||||
logger.log("Catching error = %o", err);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
@ -400,7 +403,7 @@
|
|||
function checkServer() {
|
||||
return rest.getSession(musicSessionId)
|
||||
.done(function(response) {
|
||||
console.log("assigning sessionInfo")
|
||||
logger.log("assigning sessionInfo")
|
||||
sessionInfo = response;
|
||||
})
|
||||
.fail(function(jqXHR) {
|
||||
|
|
@ -505,10 +508,8 @@
|
|||
checkServer()
|
||||
.done(function(response) {
|
||||
if(!sessionInfo.mount) {
|
||||
if (sessionInfo.session_removed_at) {
|
||||
transition(PlayStateSessionOver);
|
||||
destroy();
|
||||
}
|
||||
transition(PlayStateSessionOver);
|
||||
destroy();
|
||||
}});
|
||||
}
|
||||
}
|
||||
|
|
@ -703,26 +704,21 @@
|
|||
function openBubble() {
|
||||
checkServer().done(function(response) {
|
||||
|
||||
var mountId = sessionInfo.mount ? sessionInfo.mount.id : null
|
||||
var mountId = sessionInfo.mount ? sessionInfo.mount.id : null;
|
||||
|
||||
if(mountId) {
|
||||
rest.getMount({id: mountId})
|
||||
.done(function (mount) {
|
||||
mountInfo = mount
|
||||
$parent.data('mount-id', mountId)
|
||||
context.JK.SubscriptionUtils.subscribe('mount', mountId).on(context.JK.EVENTS.SUBSCRIBE_NOTIFICATION, onDetailEvent)
|
||||
$parent.btOn()
|
||||
mountInfo = mount;
|
||||
$parent.data('mount-id', mountId);
|
||||
context.JK.SubscriptionUtils.subscribe('mount', mountId).on(context.JK.EVENTS.SUBSCRIBE_NOTIFICATION, onDetailEvent);
|
||||
$parent.btOn();
|
||||
})
|
||||
.fail(context.JK.app.ajaxError)
|
||||
}
|
||||
else {
|
||||
mountInfo = null;
|
||||
|
||||
if (sessionInfo.session_removed_at) {
|
||||
transition(PlayStateSessionOver);
|
||||
destroy();
|
||||
}
|
||||
|
||||
destroy();
|
||||
context.JK.app.notify({"title": "Unable to Broadcast Session", "text": "This session cannot be broadcasted. The session organizer may have configured it to be private."});
|
||||
}
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in New Issue