GoogleInteractiveMediaAds Framework Reference
IMAAVPlayerContentPlayhead
An implementation of IMAContentPlayhead for AVPlayer. Use this class to
provide content tracking if your content player of choice is an AVPlayer
or its subclass.
-
Declaration
Swift
var player: AVPlayer { get }
Objective-C
@property (nonatomic, readonly) AVPlayer *_Nonnull player;
-
Initializes a IMAAVPlayerContentPlayhead that tracks a player. It will attach a periodic time
observer to the player immediately.
Declaration
Swift
init(avPlayer player: AVPlayer)
Objective-C
- (nonnull instancetype)initWithAVPlayer:(nonnull AVPlayer *)player;
Return Value
the IMAAVPlayerContentPlayhead instance
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2023-11-14 UTC.
[null,null,["Last updated 2023-11-14 UTC."],[[["IMAAVPlayerContentPlayhead is designed to track the content progress of an AVPlayer or its subclasses."],["It implements the IMAContentPlayhead protocol, providing a standard way to monitor playback."],["It utilizes a periodic time observer attached to the AVPlayer to track playback time."],["Initialization requires an AVPlayer instance and immediately begins tracking."]]],["The `IMAAVPlayerContentPlayhead` class tracks an `AVPlayer` for content playhead information. It's initialized with an `AVPlayer` instance via `initWithAVPlayer:`. Upon initialization, it immediately adds a periodic time observer to the provided player. The `player` property returns the tracked `AVPlayer` instance, enabling content tracking for AVPlayer-based media. The main actions are initializing and tracking using a AVPlayer instance.\n"]]