Video playback problem in WKWebView and iOS 16.1 on iPad with MSE

I have an app a WKWebView (using cordova) that include a HLS video player based on video.js 7.20.2 and http-streaming to support HLS (as we only target iPad, MSE is available and we should be able to use videojs-http-streaming). All was working fine on our iPad's running iOS 15.x as well as in the emulator.

Last week, some of our iPad's got upgraded to iOS 16.1 and we started to see playback becoming stuttery with frequent buffering after ~2min, up to a point where the playback completely stopped. Similar issues could then also be observed in the Xcode iOS 16.1 emulator. Running the same exact app from Xcode in the iOS 15.4 emulator, there's no issue. But in iOS 16.1 emulator, playback starts failing after about 1.30min ~ 2mins.

I was able to recreate the issue in a minimal environment, 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.xml and add the following as children of the <widget> element

<access origin="*" />
<allow-navigation href="*" />

and change the <content> tag as follows:

<content src="https://lincserver-azure.api.lincor.com/html/sintel-hls-videojs.html" />

the above is a public URL hosted on our server that contain a video.js player to play Sintel movie through HLS.

Prepare cordova iOS app

cordova platform add ios
cordova prepare ios

You can then 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.

I should also note that using the same URL in Safari shows no issue.

I forgot to mention the following: to allow playback inline in the web page, one should add the following to config.xml (also as a child of <widget>)

<preference name="AllowInlineMediaPlayback" value="true" />

although it is not necessary to trigger the playback issue.

I am able to reproduce the same problem without using cordova, with a simple iOS app with a 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.

Video playback problem in WKWebView and iOS 16.1 on iPad with MSE
 
 
Q