video-dev / hls.js

HLS.js is a JavaScript library that plays HLS in browsers with support for MSE.
https://hlsjs.video-dev.org/demo
Other
14.69k stars 2.56k forks source link

Basic test demo not work on mobile #2375

Closed konstantin55000 closed 4 years ago

konstantin55000 commented 5 years ago

What version of Hls.js are you using?

latest

What browser and OS are you using?

any mobile browser

Test stream:

https://video-dev.github.io/hls.js/stable/demo/basic-usage.html Here please, check . i've also opened it from mobile. This basic example is not working with m3u8 from any mobile bwoser from android 8.1.0

Checklist

https://github.com/video-dev/hls.js/issues/1594

Expected behavior

What you expected to happen Playing video on html5 player.

Actual behavior

What actually happened Player loaded with controls (<video controls .. ); blackscreen , no videoplayback.

Console output

Paste the contents of the browser console here.
``` Please see here: wat log in console. http://prntscr.com/p7ayt6

For media errors reported on Chrome browser, please also paste the output of chrome://media-internals

itsjamie commented 5 years ago

In your screenshot, the Console tab will have log messages from hls.js in it that can be used to help debug why you didn't see playback.

konstantin55000 commented 5 years ago

Hi Jamie, Thank you for reading this message.

Here please check http://prntscr.com/p7kpbn

Could you please make screenshot of any android mobile browser, for example this page: https://video-dev.github.io/hls.js/stable/demo/basic-usage.html (basic demo on latest hls.js)

here what happens on our page, based on basic demo. in console you may see no errors.
source code:

var streamUrl = './assets/video/360_Trim2.m3u8'; //100% valid url, no cors, same domain. var video = document.getElementById('player'); //player dom is exists if(Hls.isSupported()) { try { var hls = new Hls(); hls.loadSource(streamUrl); hls.attachMedia(video); hls.on(Hls.Events.MANIFEST_PARSED,function() { console.log('MANIFEST_PARSED'); video.play(); }); } catch(error){ logError(error); } } else if (video.canPlayType('application/vnd.apple.mpegurl')) { //apple possible fix video.src = streamUrl; video.addEventListener('loadedmetadata', function() { console.log('loadedmetadata'); video.play(); }); }

else { //initDashWithPlayer(); init dash console.error("hls was not loaded."); }
//helper functions function logEventError(event) { onError(event.detail); }

function logError(error) { console.error('Error code', error.code, 'object', error); } here you can check live example. https://tinyurl.com/yyg96e5z

As you can see it's very basic example, as in hls.js doc ; on mobile also no errors in console (Eruda). I would strongly say, that every example based on hls.js ( what we found on internet not stream on mobile. Galaxy S8, Mi note 4. Android 8.1 +

It seems problem on android is deeper, but we need to know exactly what's happening.

michaelcunningham19 commented 5 years ago

Hey @konstantin55000

I ran into this a while back on Android - can you double check if you have Data Saver disabled? https://support.google.com/chrome/answer/2392284?co=GENIE.Platform%3DAndroid&hl=en-GB

I found that when Data Saver was enabled on my mobile device, requests for m3u8s would return an empty response body

konstantin55000 commented 5 years ago

Cool, "I ran into this a while back on Android", so what results did you get for basic example page? could you please provide screenshot from mobile? [e.q send from mobile any messenger => open mesenger on desktop , attach screenshot here] Currently we have check input ffmpeg encoding options; maybe source of problem is here. Please leave issue open for this time. i'll let us know , wen we figure it out. DataSaver: interesting thougts, seems firefox , and firefox focus, as well as other browsers does not have data saver at all, but issue still present.

itsjamie commented 5 years ago

If you could copy and paste the contents of the console without the error filter on from the hls.js demo page with your content it might provide some insight as to why you aren't receiving playback.

konstantin55000 commented 4 years ago

Jamie, the issue sorce looked like hls.js, but source was in video encoding options (ffmpeg params). Excuse me for inconviniense, and Thank you for support!