Platforms to show: All Mac Windows Linux Cross-Platform
AVPlayerItemMBS class
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
class | AVFoundation | MBS AVFoundation Plugin | 13.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
A object carries a reference to an AVAsset object and presentation settings for that asset, including track enabled state. If you need to inspect the media assets themselves, you should message the AVAsset object itself.
You can initialize a player item using an URL (playerItemWithURL and Constructor); the resource types referenced by the URL may include, but aren't necessarily limited to, those with the following corresponding UTIs:
kUTTypeQuickTimeMovie, (.mov, .qt)
kUTTypeMPEG4 (.mp4)
"public.3gpp" (.3gp, .3gpp)
kUTTypeMPEG4Audio (.m4a)
"com.apple.coreaudio-format" (.caf)
"com.microsoft.waveform-audio" (.wav)
"public.aiff-audio" (.aif)
"public.aifc-audio" (also .aif)
"org.3gpp.adaptive-multi-rate-audio" (.amr)
If you want to play an asset more than once within a sequence of items, you must create independent instances of AVPlayerItem for each placement in the player's queue.
- 31 properties
- property asset as AVAssetMBS
- property audioMix as AVAudioMixMBS
- property audioTimePitchAlgorithm as String
- property canPlayFastForward as boolean
- property canPlayFastReverse as boolean
- property canPlayReverse as boolean
- property canPlaySlowForward as boolean
- property canPlaySlowReverse as boolean
- property canStepBackward as boolean
- property canStepForward as boolean
- property contentAuthorizationRequestStatus as Integer
- property currentDate as date
- property currentDateTime as DateTime
- property currentTime as CMTimeMBS
- property customVideoCompositor as AVVideoCompositingMBS
- property duration as CMTimeMBS
- property error as NSErrorMBS
- property forwardPlaybackEndTime as CMTimeMBS
- property Handle as Integer
- property isApplicationAuthorizedForPlayback as boolean
- property isAuthorizationRequiredForPlayback as boolean
- property isContentAuthorizedForPlayback as boolean
- property isPlaybackBufferEmpty as boolean
- property isPlaybackBufferFull as boolean
- property isPlaybackLikelyToKeepUp as boolean
- property nowPlayingInfo as Dictionary New in 25.0
- property presentationSize as CGSizeMBS
- property reversePlaybackEndTime as CMTimeMBS
- property seekingWaitsForVideoCompositionRendering as Boolean
- property status as Integer
- property videoComposition as AVVideoCompositionMBS
- 28 methods
- method accessLog as AVPlayerItemAccessLogMBS
- method addOutput(output as AVPlayerItemOutputMBS)
- method automaticallyLoadedAssetKeys as String()
- method cancelContentAuthorizationRequest
- method cancelPendingSeeks
- method Constructor(asset as AVAssetMBS)
- method Constructor(asset as AVAssetMBS, automaticallyLoadedAssetKeys() as string)
- method Constructor(file as folderitem)
- method Constructor(URL as string)
- method copy as AVPlayerItemMBS
- method errorLog as AVPlayerItemErrorLogMBS
- method loadedTimeRanges as CMTimeRangeMBS()
- method outputs as AVPlayerItemOutputMBS()
- method removeOutput(output as AVPlayerItemOutputMBS)
- method requestContentAuthorizationAsynchronously(timeoutInterval as Double, tag as Variant = nil)
- method seekableTimeRanges as CMTimeRangeMBS()
- method seekToDate(date as date, fireEvent as boolean = false, tag as Variant = nil) as boolean
- method seekToDateTime(date as dateTime, fireEvent as boolean = false, tag as variant = nil) as boolean
- 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 selectedMediaOptionInMediaSelectionGroup(mediaSelectionGroup as AVMediaSelectionGroupMBS) as AVMediaSelectionOptionMBS
- method selectMediaOption(mediaSelectionOption as AVMediaSelectionOptionMBS, mediaSelectionGroup as AVMediaSelectionGroupMBS)
- method selectMediaOptionAutomaticallyInMediaSelectionGroup(mediaSelectionGroup as AVMediaSelectionGroupMBS)
- method setTextStyleRules(rules() as AVTextStyleRuleMBS)
- method stepByCount(stepCount as Integer)
- method textStyleRules as AVTextStyleRuleMBS()
- method timedMetadata as AVMetadataItemMBS()
- method tracks as AVPlayerItemTrackMBS()
- 5 shared methods
- shared method available as boolean
- shared method playerItemWithAsset(asset as AVAssetMBS) as AVPlayerItemMBS
- shared method playerItemWithAsset(asset as AVAssetMBS, automaticallyLoadedAssetKeys() as string) as AVPlayerItemMBS
- shared method playerItemWithFile(file as folderitem) as AVPlayerItemMBS
- shared method playerItemWithURL(URL as string) as AVPlayerItemMBS
- 10 constants
Authorization Status
Constant | Value | Description |
---|---|---|
AVContentAuthorizationBusy | 4 |
The last call to request content authorization could not be completed because another asset is currently attempting authorization. |
AVContentAuthorizationCancelled | 2 |
The last call to request content authorization was cancelled by the user. |
AVContentAuthorizationCompleted | 1 |
The last completed call to request content authorization completed. |
AVContentAuthorizationNotAvailable | 5 |
The last call to request content authorization could not be completed because there was no known mechanism by which to attempt authorization. |
AVContentAuthorizationNotPossible | 6 |
The last call to request content authorization could not be completed in a non-recoverable way (for example, a newer version of iTunes is required). |
AVContentAuthorizationTimedOut | 3 |
The last call to request content authorization was cancelled because the timeout interval was reached. |
AVContentAuthorizationUnknown | 0 |
No call to request content authorization has completed yet. |
Status Constants
Constant | Value | Description |
---|---|---|
AVPlayerItemStatusFailed | 2 |
The item cannot be played. |
AVPlayerItemStatusReadyToPlay | 1 |
The item is ready to play. |
AVPlayerItemStatusUnknown | 0 |
The item's status is unknown. |
This class has no sub classes.
Some methods using this class:
- AVPlayerLooperMBS.Constructor(player as AVQueuePlayerMBS, item as AVPlayerItemMBS)
- AVPlayerLooperMBS.Constructor(player as AVQueuePlayerMBS, item as AVPlayerItemMBS, loopRange as CMTimeRangeMBS)
- AVPlayerLooperMBS.loopingPlayerItems as AVPlayerItemMBS()
- AVPlayerMBS.Constructor(item as AVPlayerItemMBS)
- AVPlayerMBS.replaceCurrentItemWithPlayerItem(item as AVPlayerItemMBS)
- AVQueuePlayerMBS.appendItem(item as AVPlayerItemMBS)
- AVQueuePlayerMBS.canAppendItem(item as AVPlayerItemMBS) as boolean
- AVQueuePlayerMBS.items as AVPlayerItemMBS()
- AVQueuePlayerMBS.queuePlayerWithItems(items() as AVPlayerItemMBS) as AVQueuePlayerMBS
- AVSynchronizedLayerMBS.synchronizedLayerWithPlayerItem(playerItem as AVPlayerItemMBS) as AVSynchronizedLayerMBS
Some properties using for this class:
- AVPlayerLooperMBS.item as AVPlayerItemMBS
- AVPlayerMBS.currentItem as AVPlayerItemMBS
- AVSynchronizedLayerMBS.playerItem as AVPlayerItemMBS
Some events using this class:
- AVFoundationMBS.PlayerItemDidPlayToEndTime(PlayerItem as AVPlayerItemMBS, notification as Variant)
- AVFoundationMBS.PlayerItemFailedToPlayToEndTime(PlayerItem as AVPlayerItemMBS, error as NSErrorMBS, notification as Variant)
- AVFoundationMBS.PlayerItemNewAccessLogEntry(PlayerItem as AVPlayerItemMBS, notification as Variant)
- AVFoundationMBS.PlayerItemNewErrorLogEntry(PlayerItem as AVPlayerItemMBS, notification as Variant)
- AVFoundationMBS.PlayerItemPlaybackStalled(PlayerItem as AVPlayerItemMBS, notification as Variant)
- AVFoundationMBS.playerItemSeekToDateFinished(player as AVPlayerItemMBS, date as Variant, finished as boolean, tag as Variant)
- AVFoundationMBS.playerItemSeekToTimeFinished(player as AVPlayerItemMBS, time as CMTimeMBS, toleranceBefore as CMTimeMBS, toleranceAfter as CMTimeMBS, finished as boolean, tag as Variant)
- AVFoundationMBS.PlayerItemTimeJumped(PlayerItem as AVPlayerItemMBS, notification as Variant)
- AVFoundationMBS.requestContentAuthorizationCompleted(PlayerItem as AVPlayerItemMBS, timeoutInterval as Double, tag as Variant)
Some examples using this class:
- /AVFoundation/Donut Video Player
- /AVFoundation/Donut Video Player Overlay
- /AVFoundation/Simple Player
- /AVFoundation/Transparent Player
Blog Entries
- News from the MBS Xojo Plugins Version 25.0
- MBS Xojo Plugins, version 24.6pr3
- News from the MBS Xojo Plugins Version 22.3
Release notes
- Version 25.0
- Added nowPlayingInfo property to AVPlayerItemMBS class.
The items on this page are in the following plugins: MBS AVFoundation Plugin.
AVPlayerItemLegibleOutputMBS - AVPlayerItemOutputMBS
