When Chrome Browser Throws Auto Play Error, PLAYBACK_NOT_ALLOWED Event Isn't Raised
Created by: chevonc
- Dash.js version: 2.9.2
- Browser name/version: Chrome/ 70
- OS name/version: Mac OSX
Steps to reproduce
- Open chrome in guest mode
- Try to automatically play any video with sound/volume > 0 using the dash player. You can do this on page load, etc. (ensure there is no user interaction with the webpage during this).
Observed behaviour
- Observe that browser prevents auto play with volume.
Player event below is not raised
this.mediaPlayer.on(MediaPlayer.events.PLAYBACK_NOT_ALLOWED, data =>
console.log({event: 'PLAYBACK_NOT_ALLOWED', data})
);
Console output
VideoModel.js?e251:46 Uncaught (in promise) DOMException: play() failed because the user didn't interact with the document first. https://goo.gl/xX8pDD
play @ VideoModel.js?e251:46
play @ PlaybackController.js?1a38:31
activateStream @ StreamController.js?8e01:55
onMediaSourceOpen @ StreamController.js?8e01:54
=== Full ===
Debug.js?589e:98 [14][Protection] EME detected on this user agent! (ProtectionModel_21Jan2015) Debug.js?589e:98 [20][MediaPlayer] Streaming Initialized Debug.js?589e:98 [34][MediaPlayer] Playback Initialized Debug.js?589e:98 [49][MediaPlayer] [dash.js 2.9.2] MediaPlayer has been initialized Debug.js?589e:98 [1109][DashParser] Parsing complete: ( xml2json: 43.6ms, objectiron: 0.400ms, total: 0.0440s) Debug.js?589e:98 [1147][ManifestUpdater] Manifest has been refreshed at Sat Dec 01 2018 15:29:23 GMT-0800 (Pacific Standard Time)[1543706963.004] Application Error: There was a problem getting data for the application you requested. The application may not be valid, or there may be a temporary glitch. Please try again later. Debug.js?589e:98 [1320][Stream] No text data. Debug.js?589e:98 [1321][Stream] No fragmentedText data. Debug.js?589e:98 [1323][Stream] No embeddedText data. Debug.js?589e:98 [1323][Stream] No muxed data. Debug.js?589e:98 [1323][Stream] No image data. VideoModel.js?e251:46 Uncaught (in promise) DOMException: play() failed because the user didn't interact with the document first. https://goo.gl/xX8pDD play @ VideoModel.js?e251:46 play @ PlaybackController.js?1a38:31 activateStream @ StreamController.js?8e01:55 onMediaSourceOpen @ StreamController.js?8e01:54 Debug.js?589e:98 [1411][BufferController][video] Init fragment finished loading saving to video's init cache Debug.js?589e:98 [1415][ScheduleController][video] OnFragmentLoadingCompleted - Url: http://localhost:8005/live/w841wmD1/init-stream1.m4s , Range: undefined Debug.js?589e:98 [1422][BufferController][audio] Init fragment finished loading saving to audio's init cache Debug.js?589e:98 [1425][ScheduleController][audio] OnFragmentLoadingCompleted - Url: http://localhost:8005/live/w841wmD1/init-stream5.m4s , Range: undefined Debug.js?589e:98 [1435][ScheduleController][video] Top quality video index has changed from undefined to 0 Debug.js?589e:98 [1477][PlaybackController] Native video element event: loadedmetadata Debug.js?589e:98 [1478][ScheduleController][audio] Top quality audio index has changed from undefined to 0 Debug.js?589e:98 [1492][ScheduleController][audio] OnFragmentLoadingCompleted - Url: http://localhost:8005/live/w841wmD1/chunk-stream5-00001.m4s , Range: undefined Debug.js?589e:98 [1509][ScheduleController][video] OnFragmentLoadingCompleted - Url: http://localhost:8005/live/w841wmD1/chunk-stream1-00001.m4s , Range: undefined Debug.js?589e:98 [1561][ScheduleController][video] OnFragmentLoadingCompleted - Url: http://localhost:8005/live/w841wmD1/chunk-stream1-00002.m4s , Range: undefined Debug.js?589e:98 [1609][ScheduleController][video] OnFragmentLoadingCompleted - Url: http://localhost:8005/live/w841wmD1/chunk-stream1-00003.m4s , Range: undefined Debug.js?589e:98 [1646][ScheduleController][video] OnFragmentLoadingCompleted - Url: http://localhost:8005/live/w841wmD1/chunk-stream1-00004.m4s , Range: undefined Debug.js?589e:98 [2244][ScheduleController][audio] OnFragmentLoadingCompleted - Url: http://localhost:8005/live/w841wmD1/chunk-stream5-00002.m4s , Range: undefined Debug.js?589e:98 [2335][ScheduleController][audio] OnFragmentLoadingCompleted - Url: http://localhost:8005/live/w841wmD1/chunk-stream5-00003.m4s , Range: undefined Debug.js?589e:98 [2360][ScheduleController][audio] OnFragmentLoadingCompleted - Url: http://localhost:8005/live/w841wmD1/chunk-stream5-00004.m4s , Range: undefined
Expected behavior
DashJS MediaPlayer.events.PLAYBACK_NOT_ALLOWED
is raised when this happens so that application can try again with volume muted.