Skip to content

Commit aa29e29

Browse files
committed
fixed bugs in media player and client controls (fadeOut handling)
1 parent 7714421 commit aa29e29

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

www/scripts/sepiaFW.client.controls.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,11 +241,12 @@ function sepiaFW_build_client_controls(sepiaSessionId){
241241
//Embedded media player
242242
sentAdditionalEvent = SepiaFW.ui.cards.embed.stopAllMediaPlayers();
243243
SepiaFW.debug.info("Client controls - Media: stopping embedded media player(s)");
244-
}else if (SepiaFW.ui.isAndroid){
244+
}
245+
if (SepiaFW.ui.isAndroid){
245246
//we do this only if we have a recent Android media event - otherwhise it will activate all music apps
246247
var requireMediaAppPackage = true;
247248
SepiaFW.debug.info("Client controls - Media: trying to stop Android media player");
248-
sentAdditionalEvent = SepiaFW.android.broadcastMediaButtonDownUpIntent(127, requireMediaAppPackage);
249+
sentAdditionalEvent = SepiaFW.android.broadcastMediaButtonDownUpIntent(127, requireMediaAppPackage) || sentAdditionalEvent;
249250
//127: KEYCODE_MEDIA_PAUSE
250251
}
251252
//TODO: add iOS and Windows?

www/scripts/sepiaFW.ui.actions.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ function sepiaFW_build_ui_actions(){
66
//Executes all functions in next idle state so MAKE SURE! they don't interfere with each other!
77
var delayQueue = {};
88
var delayQueueTimers = {};
9-
var delayQueueTimeout = 6000;
109
var delayId = 0;
1110
Actions.delayFunctionUntilIdle = function(fun, idleState, timeoutDelay, timeoutMessage){
1211
delayId++;
@@ -218,8 +217,8 @@ function sepiaFW_build_ui_actions(){
218217
if (delayUntilIdle || action.delayUntilIdle){
219218
Actions.delayFunctionUntilIdle(function(){
220219
SepiaFW.client.controls.handle(action.fun, action.controlData);
221-
}, "any", //idleState req.
222-
8000, "Failed to start audio (timeout).");
220+
}, "any", //idleState req. (change?)
221+
8000, "Failed to trigger client controls (timeout).");
223222
}else{
224223
SepiaFW.client.controls.handle(action.fun, action.controlData);
225224
}
@@ -407,7 +406,7 @@ function sepiaFW_build_ui_actions(){
407406
Actions.delayFunctionUntilIdle(function(){
408407
playAction(action);
409408
}, idleState,
410-
14000, "Failed to start audio (timeout).");
409+
14000, "Failed to trigger audio player (timeout).");
411410
}else{
412411
playAction(action);
413412
}

www/scripts/sepiaFW.ui.cards.embed.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ function sepiaFW_build_ui_cards_embed(){
158158
var triedToStopAtLeastOne = false;
159159
Object.values(activeMediaPlayers).forEach(function(mp){
160160
if (!except || mp != except){
161-
if (mp.isPlaying() || mp.isWaitingForPlay()){
161+
if (mp.isPlaying() || mp.isWaitingForPlay() || mp.isOnHold()){
162162
mp.pause();
163163
triedToStopAtLeastOne = true;
164164
}

0 commit comments

Comments
 (0)