Bug 34093 - No Video Playback Using AVPlayerViewController After iOS 9 Upgrade
Summary: No Video Playback Using AVPlayerViewController After iOS 9 Upgrade
Status: RESOLVED ANSWERED
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.iOS.dll ()
Version: XI 9.0 (iOS9)
Hardware: PC Windows
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2015-09-19 23:52 UTC by Adam
Modified: 2015-09-20 11:23 UTC (History)
3 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
Video player disabled (46.27 KB, image/png)
2015-09-19 23:55 UTC, Adam
Details
Example App (45.45 KB, application/x-zip-compressed)
2015-09-19 23:57 UTC, Adam
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED ANSWERED

Description Adam 2015-09-19 23:52:42 UTC
After upgrading Xamarin to iOS 9, I am no longer able to use the AVPlayerViewController to playback video. It worked perfectly fine before the upgrade. I have created and attached a simplified version of the code but the video never loads...

public partial class AVPlayerViewDemoController : AVPlayerViewController
    {
        public AVPlayerViewDemoController() : base("AVPlayerViewDemoController", null)
        {
            Player = AVPlayer.FromUrl(NSUrl.FromString("http://vjs.zencdn.net/v/oceans.mp4"));
        }
    }
Comment 1 Adam 2015-09-19 23:55:59 UTC
Created attachment 12983 [details]
Video player disabled

I always get this result with the player when running it with iOS 9.
Comment 2 Adam 2015-09-19 23:57:03 UTC
Created attachment 12984 [details]
Example App

Attaching a simplified example of my code.
Comment 3 Sebastien Pouliot 2015-09-20 10:20:07 UTC
By default iOS 9 disallow HTTP access to download content. You need to either swicth to HTTPS (Apple's preference) or opt-in [1] to continue using unsecured connections.

[1] by modifying your Info.plist, see ""App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure." in XI 9.0 release notes.

http://forums.xamarin.com/discussion/50971/stable-release-xamarin-ios-9-0-ios-9-0-upstream-release
Comment 4 Adam 2015-09-20 11:23:47 UTC
Thank you! That solved the problem. Added this to the info.plist:

<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>