iOS SDK Version
FBMediaViewVideoRenderer
Objective-C
@interfaceFBMediaViewVideoRenderer:UIView
Swift
classFBMediaViewVideoRenderer:UIView
The FBMediaViewVideoRenderer class allows for customization of the user experience for video ads in FBMediaView. This class should be subclassed, and an instance of that subclass should be passed to the videoRenderer property of an FBMediaView instance.
- The aspect ratio of the video content. Returns a positive CGFloat, or 0.0 if no ad is currently loaded.
Declaration
Objective-C@property(nonatomic,readonly)CGFloataspectRatio;
SwiftvaraspectRatio:CGFloat{get}
- The current video playback time, as a CMTime value.
Declaration
Objective-C@property(nonatomic,readonly)CMTimecurrentTime;
SwiftvarcurrentTime:CMTime{get}
- The duration of the video, as a CMTime value. Returns kCMTimeIndefinite if no video is loaded.
Declaration
Objective-C@property(nonatomic,readonly)CMTimeduration;
Swiftvarduration:CMTime{get}
- Indicates whether the video is currently playing.
Declaration
Objective-C@property(nonatomic,readonly,getter=isPlaying)BOOLplaying;
SwiftvarisPlaying:Bool{get}
- The current volume of the video, ranging from 0.0 through 1.0.
Declaration
Objective-C@property(nonatomic)floatvolume;
Swiftvarvolume:Float{getset}
- Starts or resumes video playback.
Declaration
Objective-C-(void)playVideo;
SwiftfuncplayVideo()
- Pauses video playback.
Declaration
Objective-C-(void)pauseVideo;
SwiftfuncpauseVideo()
- Used to put the video into seek mode. Video playback halts, and one or more calls to seekVideoToTime: can be made before calling disengageVideoSeek.
Declaration
Objective-C-(void)engageVideoSeek;
SwiftfuncengageVideoSeek()
- Take the video out of seek mode.
Declaration
Objective-C-(void)disengageVideoSeek;
SwiftfuncdisengageVideoSeek()
- Seeks the video to a particular time location. Only works after calling
engageVideoSeek
.Declaration
Objective-C-(void)seekVideoToTime:(CMTime)time;
SwiftfuncseekVideo(totime:CMTime)
Parameters
- Requests the periodic invocation of a given block during playback to report changing time.
Declaration
Objective-C-(nullableid)addPeriodicTimeObserverForInterval:(CMTime)intervalqueue:(nonnulldispatch_queue_t)queueusingBlock:(nonnullvoid(^)(CMTime))block;
SwiftfuncaddPeriodicTimeObserver(forIntervalinterval:CMTime,queue:DispatchQueue,usingblock:@escaping(CMTime)->Void)->Any?
Parameters
- Cancels a previously registered periodic time observer.
Declaration
Objective-C-(void)removeTimeObserver:(nonnullid)observer;
SwiftfuncremoveTimeObserver(_observer:Any)
- Called when the video volume has changed.
Declaration
Objective-C-(void)videoDidChangeVolume;
SwiftfuncvideoDidChangeVolume()
- Called when video content has loaded.
Declaration
Objective-C-(void)videoDidLoad;
SwiftfuncvideoDidLoad()
- Called when video playback was paused.
Declaration
Objective-C-(void)videoDidPause;
SwiftfuncvideoDidPause()
- Called when video playback has begun or was resumed.
Declaration
Objective-C-(void)videoDidPlay;
SwiftfuncvideoDidPlay()
- Called when seek mode was engaged.
Declaration
Objective-C-(void)videoDidEngageSeek;
SwiftfuncvideoDidEngageSeek()
- Called when a video seek was performed.
Declaration
Objective-C-(void)videoDidSeek;
SwiftfuncvideoDidSeek()
- Called when seek mode was disengaged.
Declaration
Objective-C-(void)videoDidDisengageSeek;
SwiftfuncvideoDidDisengageSeek()
- Called when video playback ends.
Declaration
Objective-C-(void)videoDidEnd;
SwiftfuncvideoDidEnd()
- Called when video playback encounters an error.
Declaration
Objective-C-(void)videoDidFailWithError:(nonnullNSError*)error;
SwiftfuncvideoDidFailWithError(_error:Error)