Called to inform the VideoDisplay to load the passed URL with the subtitles for the stream.
Subtitles are available only for dynamic ad insertion VOD streams and can be ignored
for client side ads or dynamic ad insertion live streams.
the subtitles for the stream. Each entry in the subtitles array is an
NSDictionary that corresponds to a language. Each dictionary will have a
language key with a two letter language string value, a language name
to specify the set of subtitles if multiple sets exist for the same language,
and one or more subtitle key/value pairs. Here’s an example NSDictionary for
English:
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-20 UTC."],[[["\u003cp\u003e\u003ccode\u003eIMAVideoDisplay\u003c/code\u003e is a protocol that declares methods for controlling ad playback within a video player.\u003c/p\u003e\n"],["\u003cp\u003eIt allows publishers to manage playback (play, pause, reset), volume, and stream loading, including subtitles for dynamic ad insertion in VOD streams.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003edelegate\u003c/code\u003e property enables the publisher to send player events to the SDK, facilitating communication between the player and the ad framework.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eloadStream\u003c/code\u003e method is used to initialize playback with a given URL, supporting subtitles in specific formats like WebVTT and TTML.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eseekStreamToTime\u003c/code\u003e provides control over the stream's playback position, allowing for seeking to specific points in time.\u003c/p\u003e\n"]]],["The `IMAVideoDisplay` protocol manages ad playback, enabling publishers to send player events. Key actions include setting and getting the ad volume (from 0 to 1), loading a stream via a URL and optional subtitles (dynamic VOD only), playing, pausing, resetting (removing video assets), and seeking the stream to a specific time. The delegate property allows for sending player events, and subtitles are passed as an array of dictionaries containing language information.\n"],null,["# GoogleInteractiveMediaAds Framework Reference\n\nIMAVideoDisplay\n===============\n\n @protocol IMAVideoDisplay \u003c../Protocols/IMAAdPlaybackInfo.html\u003e\n\nDeclares a simple video display class used for ad playback.\n- `\n ``\n ``\n `\n\n ### [delegate](#/c:objc(pl)IMAVideoDisplay(py)delegate)\n\n `\n ` \n Allows the publisher to send player events to the SDK. \n\n #### Declaration\n\n Swift \n\n weak var delegate: (any ../Protocols/IMAVideoDisplayDelegate.html)? { get set }\n\n Objective-C \n\n @property (nonatomic, weak, nullable) id\u003c../Protocols/IMAVideoDisplayDelegate.html\u003e delegate;\n\n- `\n ``\n ``\n `\n\n ### [volume](#/c:objc(pl)IMAVideoDisplay(py)volume)\n\n `\n ` \n Set and get the volume for the current ad. From 0 (muted) to 1 (loudest). This volume is\n relative to device volume, not absolute. Default value is 1. \n\n #### Declaration\n\n Swift \n\n var volume: Float { get set }\n\n Objective-C \n\n @property (nonatomic) float volume;\n\n- `\n ``\n ``\n `\n\n ### [-loadStream:withSubtitles:](#/c:objc(pl)IMAVideoDisplay(im)loadStream:withSubtitles:)\n\n `\n ` \n Called to inform the VideoDisplay to load the passed URL with the subtitles for the stream.\n Subtitles are available only for dynamic ad insertion VOD streams and can be ignored\n for client side ads or dynamic ad insertion live streams. \n\n #### Declaration\n\n Swift \n\n func loadStream(_ streamURL: URL, withSubtitles subtitles: [[String : String]])\n\n Objective-C \n\n - (void)loadStream:(nonnull NSURL *)streamURL\n withSubtitles:\n (nonnull NSArray\u003cNSDictionary\u003cNSString *, NSString *\u003e *\u003e *)subtitles;\n\n #### Parameters\n\n |-------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n | ` `*streamURL*` ` | the URL of the stream |\n | ` `*subtitles*` ` | the subtitles for the stream. Each entry in the subtitles array is an *NSDictionary* that corresponds to a language. Each dictionary will have a *language* key with a two letter language string value, a *language name* to specify the set of subtitles if multiple sets exist for the same language, and one or more subtitle key/value pairs. Here's an example NSDictionary for English: \"language\" -\u003e \"en\" \"language_name\" -\u003e \"English\" \"webvtt\" -\u003e \"https://somedomain.com/vtt/en.vtt\" \"ttml\" -\u003e \"https://somedomain.com/ttml/en.ttml\" |\n\n- `\n ``\n ``\n `\n\n ### [-play](#/c:objc(pl)IMAVideoDisplay(im)play)\n\n `\n ` \n Called to inform the VideoDisplay to play. \n\n #### Declaration\n\n Swift \n\n func play()\n\n Objective-C \n\n - (void)play;\n\n- `\n ``\n ``\n `\n\n ### [-pause](#/c:objc(pl)IMAVideoDisplay(im)pause)\n\n `\n ` \n Called to inform the VideoDisplay to pause. \n\n #### Declaration\n\n Swift \n\n func pause()\n\n Objective-C \n\n - (void)pause;\n\n- `\n ``\n ``\n `\n\n ### [-reset](#/c:objc(pl)IMAVideoDisplay(im)reset)\n\n `\n ` \n Called to remove all video assets from the player. \n\n #### Declaration\n\n Swift \n\n func reset()\n\n Objective-C \n\n - (void)reset;\n\n- `\n ``\n ``\n `\n\n ### [-seekStreamToTime:](#/c:objc(pl)IMAVideoDisplay(im)seekStreamToTime:)\n\n `\n ` \n Called to inform that the stream needs to be seeked to the given time. \n\n #### Declaration\n\n Swift \n\n func seekStream(toTime time: TimeInterval)\n\n Objective-C \n\n - (void)seekStreamToTime:(NSTimeInterval)time;\n\n #### Parameters\n\n |--------------|-----------------------------------------------|\n | ` `*time*` ` | the time to which the stream should be seeked |"]]