shaka-project / shaka-player

JavaScript player library / DASH & HLS client / MSE-EME player
Apache License 2.0
7.17k stars 1.34k forks source link

Safari HLS playback issue, works fine with native HTML5 video player in Safari #7471

Open joeyjiron06 opened 1 week ago

joeyjiron06 commented 1 week ago

Have you read the FAQ and checked for duplicate open issues? Yes

If the problem is related to FairPlay, have you read the tutorial?

N/A

What version of Shaka Player are you using?

4.11.9

Can you reproduce the issue with our latest release version? yes

Can you reproduce the issue with the latest code from main? yes

Are you using the demo app or your own custom app? i tried in both and the both error out with the same error

If custom app, can you reproduce the issue using our demo app? yes

What browser and OS are you using? Safari Mac OSX 14.5 (23F79) Safari iOS 18.0.1

For embedded devices (smart TVs, etc.), what model and firmware version are you using?

What are the manifest and license server URIs? https://cdn-dynmedia-1.microsoft.com/is/content/microsoftcorp/why-surface-pro-9-world-class-design-labs-feature_video_en-us-AVS.m3u8?packagedStreaming=true

What configuration are you using? What is the output of player.getNonDefaultConfiguration()? {}

What did you do?

shaka.polyfill.installAll();

const player = new shaka.Player();
const url = 'https://cdn-dynmedia-1.microsoft.com/is/content/microsoftcorp/why-surface-pro-9-world-class-design-labs-feature_video_en-us-AVS.m3u8?packagedStreaming=true';

await player.attach(videoElement);
await player.load(url);

What did you expect to happen? The player should play the whole video.

What actually happened? The player plays the first ~16 seconds, then freezes and doesn't continue playback. When i tested this with a native HTML5 Video element and use the same url, the entire video plays back just fine without any issues.

https://github.com/user-attachments/assets/a66b8233-4294-41ad-abc8-80ff74570ca7

Are you planning send a PR to fix it? no

joeyparrish commented 1 week ago

I played this in the demo, and I see lots of "Possible encoding problem detected! Unexpected buffered range for reference ..."

I also see Jumping forward 1.193695 seconds because of gap starting at 16.141 and ending at 17.017, which corresponds to your 16-second playback.

joeyparrish commented 1 week ago

Since your content uses TS and gets transmuxed, this could be related to this issue where the transmuxer creates gappy output that stalls out on Safari: https://github.com/shaka-project/shaka-player/issues/7462

joeyparrish commented 1 week ago

Someone pinged me privately to say this content has segments that do not start with an IDR frame, and that this may be an unique aspect to the issue.

joeyjiron06 commented 6 days ago

are you saying that PR fixes this issue? happy to give more details if you neeed

joeyparrish commented 6 days ago

I asked the author if it did, and he says it does not. If that's incorrect, please let us know! You can try the latest code from main or use the nightly build from here: https://nightly-dot-shaka-player-demo.appspot.com/dist/shaka-player.compiled.js

devinj-msft commented 6 days ago

I asked the author if it did, and he says it does not. If that's incorrect, please let us know! You can try the latest code from main or use the nightly build from here: https://nightly-dot-shaka-player-demo.appspot.com/dist/shaka-player.compiled.js

Unfortunately, this still reproduces on Safari iOS or Mac on the latest build just released. Reproduces in the demo app also. Does not reproduce when using the native video element still.