AVFoundation.AVPlayer Class
Encapsulates the control and UI of a component that plays back single or multiple items.

See Also: AVPlayer Members

Syntax

[Foundation.Register("AVPlayer", true)]
[ObjCRuntime.Availability(Introduced=ObjCRuntime.Platform.iOS_4_0)]
public class AVPlayer : Foundation.NSObject

Remarks

An AVFoundation.AVPlayer links the visual presentation, control, and dynamic state of one or more AVFoundation.AVAssets.

The visual element of the display is done by a AVFoundation.AVPlayerLayer, while it's current state (current time, etc.) is held in an AVFoundation.AVPlayerItem, which in turn references an AVFoundation.AVAsset.

C# Example

var asset = AVAsset.FromUrl(NSUrl.FromFilename("sample.m4v"));
var playerItem = new AVPlayerItem(asset);
var player = new AVPlayer(playerItem);
var playerLayer = AVPlayerLayer.FromPlayer(player);
View.Layer.AddSublayer(playerLayer);
player.Play();
          

Related content

Requirements

Namespace: AVFoundation
Assembly: Xamarin.iOS (in Xamarin.iOS.dll)
Assembly Versions: 0.0.0.0