|Type||Topic||Plugin||Version||macOS||Windows||Linux||Console & Web||iOS|
|class||AVFoundation||MBS AVFoundation Plugin||13.2||Yes||No||No||Yes, macOS only||No|
The multiple-item case supports advanced behaviors.
AVPlayer works equally well with local and remote media files, providing you with appropriate information about readiness to play or about the need to await additional data before continuing.
You can display the visual content of items played by an instance of AVPlayer in a CoreAnimation layer of class AVPlayerLayer; to synchronize real-time playback with other CoreAnimation layers, you can use AVSynchronizedLayer. You cannot use an instance of AVVideoCompositionCoreAnimationTool with an AVPlayer object; for offline rendering you should instead use AVAssetExportSession.
You can observe the status of a player using key-value observing. So that you can add and remove observers safely, AVPlayer serializes notifications of changes that occur dynamically during playback on a dispatch queue. By default, this queue is the main queue . To ensure safe access to a player's nonatomic properties while dynamic changes in playback state may be reported, you must serialize access with the receiver's notification queue. In the common case, such serialization is naturally achieved by invoking AVPlayer's various methods on the main thread or queue.
- 13 properties
- property ActionAtItemEnd as Integer
- property appliesMediaSelectionCriteriaAutomatically as Boolean
- property audioOutputDeviceUniqueID as String
- property ClosedCaptionDisplayEnabled as boolean
- property currentItem as AVPlayerItemMBS
- property currentTime as CMTimeMBS
- property error as NSErrorMBS
- property Handle as Integer
- property Muted as boolean
- property Playing as Boolean
- property rate as Double
- property status as Integer
- property volume as Double
- 17 methods
- method addBoundaryTimeObserverForTimes(times() as CMTimeMBS, tag as Variant = nil) as AVPlayerTimeObserverMBS
- method addPeriodicTimeObserverForInterval(interval as CMTimeMBS, tag as Variant = nil) as AVPlayerTimeObserverMBS
- method cancelPendingPrerolls
- method Constructor
- method Constructor(File as folderitem)
- method Constructor(item as AVPlayerItemMBS)
- method Constructor(URL as string)
- method mediaSelectionCriteriaForMediaCharacteristic(mediaCharacteristic as string) as AVPlayerMediaSelectionCriteriaMBS
- method pause
- method play
- method prerollAtRate(rate as Double, tag as Variant)
- method replaceCurrentItemWithPlayerItem(item as AVPlayerItemMBS)
- method seekToDate(date as date, fireEvent as boolean = false, tag as Variant = nil)
- method seekToTime(time as CMTimeMBS, fireEvent as boolean = false, tag as Variant = nil)
- method seekToTime(time as CMTimeMBS, toleranceBefore as CMTimeMBS, toleranceAfter as CMTimeMBS, fireEvent as boolean = false, tag as Variant = nil)
- method setMediaSelectionCriteria(criteria as AVPlayerMediaSelectionCriteriaMBS, mediaCharacteristic as string)
- method setRate(rate as Double, time as CMTimeMBS, HostTime as CMTimeMBS)
- 5 shared methods
- shared method available as boolean
- shared method playerWithFile(File as folderitem) as AVPlayerMBS
- shared method playerWithPlayerItem(item as AVPlayerItemMBS) as AVPlayerMBS
- shared method playerWithURL(URL as string) as AVPlayerMBS
- shared method removeTimeObserver(observer as AVPlayerTimeObserverMBS)
- 6 constants
Actions for the item end Constants
Indicates that the player should advance to the next item, if there is one.
Indicates that the player should do nothing.
Indicates that the player should pause playing.
Indicates that the player can no longer play AVPlayerItem instances because of an error.
The error is described by the value of the player's error property.
Indicates that the player is ready to play AVPlayerItem instances.
Indicates that the status of the player is not yet known because it has not tried to load new media resources for playback.
Some methods using this class:
- AVPlayerLayerMBS.Constructor(player as AVPlayerMBS)
- AVPlayerLayerMBS.playerLayerWithPlayer(player as AVPlayerMBS) as AVPlayerLayerMBS
- MoviePlayer.AVPlayerMBS as AVPlayerMBS
Some properties using for this class:
Some events for this class:
- AVFoundationMBS.BoundaryTimeObserver(Player as AVPlayerMBS, tag as Variant)
- AVFoundationMBS.PeriodicTimeObserver(Player as AVPlayerMBS, time as CMTimeMBS, tag as Variant)
- AVFoundationMBS.playerSeekToDateFinished(player as AVPlayerMBS, date as date, finished as boolean, tag as Variant)
- AVFoundationMBS.playerSeekToTimeFinished(player as AVPlayerMBS, time as CMTimeMBS, toleranceBefore as CMTimeMBS, toleranceAfter as CMTimeMBS, finished as boolean, tag as Variant)
Some examples which use this class:
- /AVFoundation/AVPlayerView test
- /AVFoundation/Donut Video Player
- /AVFoundation/Donut Video Player Overlay
- /AVFoundation/MoviePlayer Rate
- /AVFoundation/Simple Player
- /AVFoundation/Transparent Player
The items on this page are in the following plugins: MBS AVFoundation Plugin.
MBS Xojo PDF Plugins