ios-samples/ios9/PictureInPicture
Rolf Bjarne Kvinge c48c4d648c
Add .editorconfig and fix formatting accordingly. (#471)
The new .editorconfig is copied from the one in xamarin/xamarin-macios.

Formatting was fixed using 'dotnet format whitespace --folder .'
2023-02-17 14:55:43 +01:00
..
PictureInPicture Add .editorconfig and fix formatting accordingly. (#471) 2023-02-17 14:55:43 +01:00
Screenshots [PictureInPicture] move sample to public repo 2015-10-16 15:37:25 +03:00
LICENSE.txt [PictureInPicture] Add license 2016-02-19 12:43:15 -03:00
PictureInPicture.sln [PictureInPicture] move sample to public repo 2015-10-16 15:37:25 +03:00
README.md remove hashtags ios9 ios10 watchos 2019-07-24 17:48:58 -07:00
metadata.xml [PictureInPicture] move sample to public repo 2015-10-16 15:37:25 +03:00

README.md

name description page_type languages products extensions urlFragment
Xamarin.iOS - PictureInPicture Demonstrates the use of AVPictureInPictureController to get picture in picture playback of video content from an application (iOS9) sample
csharp
xamarin
tags
ios9
ios9-pictureinpicture

PictureInPicture

This sample demonstrates the use of AVPictureInPictureController to get picture in picture playback of video content from an application. It shows the steps required to be able to start and stop picture in picture mode and also on how to setup a delegate to receive event callbacks. Clients of AVFoundation using AVPlayerLayer for media playback should use AVPictureInPictureController class, whereas clients of AVKit who use AVPlayerViewController get picture in picture mode without any additional setup.

The sample also demonstrates the configuration setup required by an application to be able to use picture in picture. This configuration involves:

  1. Setting UIBackgroundMode to audio under the project settings.

  2. Setting audio session category to AVAudioSessionCategoryPlayback or AVAudioSessionCategoryPlayAndRecord (as appropriate)

If an application is not configured correctly, AVPictureInPictureController.PictureInPicturePossible () returns false.

The AppDelegate class configures the application as described above.

The PlayerViewController class creates and manages an AVPictureInPictureController object. It also handles delegate callbacks to setup / restore UI when in picture in picture. This class also handles the playback setup and UI.

PictureInPicture application screenshot

Build Requirements

Building this sample requires Xcode 7.0 and iOS 9.0 SDK

References

Original sample

Target

This sample runnable on iPad/iPadSimulator

License

Xamarin port changes are released under the MIT license