From 705f1e029b0221326aca0a8aa7cf54fc1637ae3b Mon Sep 17 00:00:00 2001 From: "M. Voerman" Date: Sun, 9 Oct 2016 23:56:22 +0200 Subject: Hopefully fixed the blackscreen bug switching channel after error --- javascript/main.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/javascript/main.js b/javascript/main.js index 2ec0d2a..3a0858e 100644 --- a/javascript/main.js +++ b/javascript/main.js @@ -520,9 +520,10 @@ function play(uri) { if (Delay_Play == 1) { if (initialDelayID != -1) { clearTimeout(initialDelayID); initialDelayID = -1; } if (PlayDelayID != -1) { clearTimeout(PlayDelayID); PlayDelayID = -1; } - if (initialDelayPlayID != -1) { clearTimeout(initialDelayPlayID); initialDelayPlayID = -1; } } + if (initialDelayPlayID != -1) { clearTimeout(initialDelayPlayID); initialDelayPlayID = -1; } + if (mediaPlayer.getState() != mediaPlayer.STATE_IDLE) { mediaPlayer.close(); } if (isSchedule) { schedule.style.opacity = 0; isSchedule = 0;} if (epgactive) { epg_unactive();} @@ -3598,7 +3599,7 @@ function MPD(ev) { if (MPDListener == 0) { if (ev.state == 6 ) { if (ev.reason == "CommandClose" && ErrorAgain == 0) { - setTimeout("mediaPlayer.open(URL);mediaPlayer.play(1000);GetEPG(currChan);ExtraStuff();",initialDelayPlay); + initialDelayPlayID = setTimeout("mediaPlayer.open(URL);mediaPlayer.play(1000);GetEPG(currChan);ExtraStuff();",TryingInterval); ErrorAgain = 1; } else if (KeepTrying) { ErrorAgain = 0; -- cgit v1.2.3