videojs / http-streaming

HLS, DASH, and future HTTP streaming protocols library for video.js
https://videojs-http-streaming.netlify.app/
Other
2.49k stars 422 forks source link

Playback problem in WKWebView and iOS 16.1 on iPad with MSE #1350

Open goffioul opened 1 year ago

goffioul commented 1 year ago

Description

I have an iOS app based on a WKWebView, which uses videojs internally to play HLS streams (using MSE, which is available on iPads, our target device). Since upgrading our test iPads to iOS 16.1, we are encountering playback problems after a couple of minutes, with stuttering, buffering and usually full playback stop. The issue is fully described in this post, with a description of a test environment to reproduce the problem in iOS emulator using a trivial cordov app:

https://developer.apple.com/forums/thread/719080

The app running in the iOS 15.4 emulator works fine. But fails when running in iOS 16 emulator.

Steps to reproduce

I am able to reproduce the issue in iOS emulator using a test cordova app, as follows.

  1. First setup cordova environment:
    npm install cordova
    export PATH=$PWD/node_modules/.bin:$PATH
  2. Create a new cordova app and add iOS platform
    cordova create video com.example.test.video "Test Video"
    cd video
    cordova platform add ios
  3. Edit config.xml and add the following as children of the <widget> element
    <access origin="*" />
    <allow-navigation href="*" />
    <preference name="AllowInlineMediaPlayback" value="true" />
  4. Edit config.xml and change the <content> tag as follows (this is a public URL hosted on our server that contain a video.js player to play Sintel movie through HLS):
    <content src="https://lincserver-azure.api.lincor.com/html/sintel-hls-videojs.html" />
  5. Prepare cordova iOS app
    cordova platform add ios
    cordova prepare ios
  6. Open the project platforms/ios/Test Video.xcodeproj in Xcode, build it and then run it in iOS emulator.

When running on iOS 16.1 iPad emulator, playback starts failing at about the 2min mark. There's no issue on iOS 15.4 emulator.

Results

Expected

Video plays normally.

Error output

After a couple of minutes, playback starts stuttering, buffering. On real iPad hardware, it can also completely stops.

Additional Information

videojs-http-streaming version

videojs-http-streaming 2.14.2

videojs version

video.js 7.20.2

Browsers

Cordova app using WKWebView

Platforms

iOS 16.1 (on iPad, using MSE)

welcome[bot] commented 1 year ago

👋 Thanks for opening your first issue here! 👋

If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can. To help make it easier for us to investigate your issue, please follow the contributing guidelines.

goffioul commented 1 year ago

The same problem is also observed without using cordova, with a simple iOS app and WKWebView:

In iOS 16.1 emulator, video starts stuttering after ~1.30min. In iOS 15.4 emulator, playback is fine.

tzarebczan commented 1 year ago

anymore progress or insights on this?