Try to show a progress bar in the media player

This commit is kind of a hack to force MediaElement.js to show a
progress bar when we are loading a song.

Normally, in vanilla HTML5 MediaElement, we'd explicitely call 'play()'
when loading a song. Here, we cannot ensure playback will work well if
we don't wait for the 'canplay' event to be fired, but the progress bar
won't show up without 'play()'...

This commit emits a fake 'waiting' event to let the MEJS know that it
should update the UI.
master
François-Xavier Thomas 6 years ago
parent 5a72322772
commit 2e0134259d
  1. 6
      airsonic-main/src/main/webapp/WEB-INF/jsp/playQueue.jsp

@ -577,6 +577,12 @@
// the 'createMediaElementPlayer()' function above.
//
// player.play();
// FIXME: Remove once https://github.com/mediaelement/mediaelement/issues/2650 is fixed.
//
// Instead, we're triggering a 'waiting' event so that the player shows
// a progress bar to indicate that it's loading the stream.
player.dispatchEvent(new Event("waiting"));
}
function skip(index, position) {

Loading…
Cancel
Save