Playback problem in WKWebView and iOS 16.1 on iPad with MSE
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.
- First setup cordova environment:
npm install cordova
export PATH=$PWD/node_modules/.bin:$PATH
- Create a new cordova app and add iOS platform
cordova create video com.example.test.video "Test Video"
cd video
cordova platform add ios
- Edit
config.xmland add the following as children of the<widget>element
<access origin="*" />
<allow-navigation href="*" />
<preference name="AllowInlineMediaPlayback" value="true" />
- Edit
config.xmland 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" />
- Prepare cordova iOS app
cordova platform add ios
cordova prepare ios
- Open the project
platforms/ios/Test Video.xcodeprojin 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)
👋 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.
The same problem is also observed without using cordova, with a simple iOS app and WKWebView:
- in Xcode, create a new iOS app (Storyboard and Objective-C)
- in the main scene, add a WKWebView (add WebKit as build dependency)
- in ViewController.didViewLoad, retrieve the WKWebView and load the URL
https://lincserver-azure.api.lincor.com/html/sintel-hls-videojs.html
In iOS 16.1 emulator, video starts stuttering after ~1.30min. In iOS 15.4 emulator, playback is fine.
anymore progress or insights on this?