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

See Also: AVPlayer Members

Syntax

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

Remarks

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

The visual element of the display is done by a MonoTouch.AVFoundation.AVPlayerLayer, while it's current state (current time, etc.) is held in an MonoTouch.AVFoundation.AVPlayerItem, which in turn references an MonoTouch.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: MonoTouch.AVFoundation
Assembly: monotouch (in monotouch.dll)
Assembly Versions: 0.0.0.0