UnityPlugin-AVProVideo icon indicating copy to clipboard operation
UnityPlugin-AVProVideo copied to clipboard

HLS+AES-128 plays audio only with iOS 16

Open dwenegar opened this issue 2 years ago • 10 comments

Describe the issue

Blank screen when streaming multi-chunk videos on iOS 16 beta.

Your Setup (please complete the following information):

  • Unity version: 2020.3.36f1
  • AVPro Video version:
    • 2.5.7 trial
  • Operating system version: iOS 16.0
  • Device model: iPhone 13 Pro Max (but it happens on any device)
  • Video specs (resolution, frame-rate, codec, file size):
    • frame-rate: 60
    • codec H264 - MPEG-4

Logs look normal but _state.status.HasUpdatedTexture() at AppleMediaPlayer.cs:312 returns always false.

dwenegar avatar Aug 08 '22 08:08 dwenegar

Hi @dwenegar,

Could you try opening a new project with our Demo_MediaPlayer scene with the video samples we have included? Are there any other file types that are not playing? Do you have a device with an earlier version of iOS to test the files on?

Chris-RH avatar Aug 08 '22 11:08 Chris-RH

Hi @Chris-RH

Could you try opening a new project with our Demo_MediaPlayer scene with the video samples we have included?

All the video samples play correctly.

Are there any other file types that are not playing?

So far only one specific HLS stream. Additionally, the very same stream not playing correctly with AVPro, plays correctly in Safari and VLC.

Do you have a device with an earlier version of iOS to test the files on?

Yes: non-beta versions of iOS do not manifest the described problem.

dwenegar avatar Aug 08 '22 11:08 dwenegar

OK, thank you very much for the information. Unfortunately we cannot support for beta releases of OSs, as there are likely to be quite a few changes before the final version is released.
We will be supporting iOS 16 when it comes out officially, so we will look out for this if the problem is still occurring.

Chris-RH avatar Aug 08 '22 12:08 Chris-RH

Hello @Chris-RH, I think that this issue could be reopened. After the update to iOS 16, that was released on September 12th, all the HLS stream videos are not working. All the logs looks normal, just like @dwenegar mentioned.

mateus-capelesso avatar Sep 16 '22 02:09 mateus-capelesso

Thanks. It would be great if you could provide a bit more information Unity version: AVPro Version: Device What files you are having problems with (resolution, type etc ) A full log would be really helpful if you can provide one, please

Chris-RH avatar Sep 16 '22 06:09 Chris-RH

Sure @Chris-RH

Unity Version: 2021.3.5f1 Device: iPhone 13 Pro (iOS 16) HLS encrypted videos are not being rendered, but I can hear them. All other type of videos (non HLS encrypted are working fine). All of our videos are 1080p.

I'm sending two log files. The full one has all the logs from the device. The other one, just the logs from our application. avpro-ios16.log avpro-ios16-full.log

mateus-capelesso avatar Sep 16 '22 10:09 mateus-capelesso

Brilliant, thank you so much @mateus-capelesso. Our iOS dev is away until Tuesday (Its a Bank holiday here in the UK), so he'll look at it then.

Chris-RH avatar Sep 16 '22 10:09 Chris-RH

Hey @mateus-capelesso, could you tell me more about how the HLS streams are being encrypted? Are you able to share one of these streams so that we can test it here? Thanks!

MorrisRH avatar Sep 20 '22 08:09 MorrisRH

Hey @MorrisRH, we are using AES-128 + CloudFront signed cookies.

mateus-capelesso avatar Sep 20 '22 10:09 mateus-capelesso

I've reproduced the issue here and unfortunately it does seem to be something in the internals of AVFoundation. In essence the low-level player instance does not produce frames when playing an AES-128 encrypted HLS video when running iOS 16.

I've opened an issue with Apple so hopefully they will get back to me with something.

For now I'm afraid that we cannot support HLS+AES-128 on devices running iOS 16.

MorrisRH avatar Sep 20 '22 12:09 MorrisRH

Hello,

Is there any update on this?

I'm having the same problem here and my app has a lot of these ):

Thanks!

bgalerani94 avatar Sep 28 '22 10:09 bgalerani94

We're still waiting to hear back from Apple. We'll keep this thread updated when we know anything more :)

Chris-RH avatar Sep 28 '22 10:09 Chris-RH

We are facing the same issue here. When we try to play the live stream in a native iOS app we don't have the issue though.

guerwan avatar Sep 28 '22 17:09 guerwan

Hey @guerwan, how are you playing the stream in your native app? The issue is with AVPlayerItemVideoOutput under the hood so you won't see it if you're just using AVPlayerViewController or AVPlayerLayer for the video output.

MorrisRH avatar Sep 29 '22 07:09 MorrisRH

@MorrisRH you're right we are using AVPlayerViewController.

guerwan avatar Sep 29 '22 07:09 guerwan

@MorrisRH Apparently the issue has been fixed now in iOS 16.1 beta 4.

guerwan avatar Oct 05 '22 10:10 guerwan

That sounds promising. Hopefully it won't be too long until 16.1 is released into the wild and we shall see :)

Chris-RH avatar Oct 05 '22 10:10 Chris-RH

already fixed?

Rex-121 avatar Nov 01 '22 09:11 Rex-121

A quick test using the latest AVPro Video (version 2.6.6) and iOS 16.1 shows that this is now fixed.

MorrisRH avatar Nov 14 '22 12:11 MorrisRH