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;
    Swift
    varaspectRatio:CGFloat{get}
  • The current video playback time, as a CMTime value.

    Declaration

    Objective-C
    @property(nonatomic,readonly)CMTimecurrentTime;
    Swift
    varcurrentTime: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;
    Swift
    varduration:CMTime{get}
  • Indicates whether the video is currently playing.

    Declaration

    Objective-C
    @property(nonatomic,readonly,getter=isPlaying)BOOLplaying;
    Swift
    varisPlaying:Bool{get}
  • The current volume of the video, ranging from 0.0 through 1.0.

    Declaration

    Objective-C
    @property(nonatomic)floatvolume;
    Swift
    varvolume:Float{getset}
  • Starts or resumes video playback.

    Declaration

    Objective-C
    -(void)playVideo;
    Swift
    funcplayVideo()
  • Pauses video playback.

    Declaration

    Objective-C
    -(void)pauseVideo;
    Swift
    funcpauseVideo()
  • 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;
    Swift
    funcengageVideoSeek()
  • Take the video out of seek mode.

    Declaration

    Objective-C
    -(void)disengageVideoSeek;
    Swift
    funcdisengageVideoSeek()
  • Seeks the video to a particular time location. Only works after calling engageVideoSeek.

    Declaration

    Objective-C
    -(void)seekVideoToTime:(CMTime)time;
    Swift
    funcseekVideo(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;
    Swift
    funcaddPeriodicTimeObserver(forIntervalinterval:CMTime,queue:DispatchQueue,usingblock:@escaping(CMTime)->Void)->Any?

    Parameters

  • Cancels a previously registered periodic time observer.

    Declaration

    Objective-C
    -(void)removeTimeObserver:(nonnullid)observer;
    Swift
    funcremoveTimeObserver(_observer:Any)
  • Called when the video volume has changed.

    Declaration

    Objective-C
    -(void)videoDidChangeVolume;
    Swift
    funcvideoDidChangeVolume()
  • Called when video content has loaded.

    Declaration

    Objective-C
    -(void)videoDidLoad;
    Swift
    funcvideoDidLoad()
  • Called when video playback was paused.

    Declaration

    Objective-C
    -(void)videoDidPause;
    Swift
    funcvideoDidPause()
  • Called when video playback has begun or was resumed.

    Declaration

    Objective-C
    -(void)videoDidPlay;
    Swift
    funcvideoDidPlay()
  • Called when seek mode was engaged.

    Declaration

    Objective-C
    -(void)videoDidEngageSeek;
    Swift
    funcvideoDidEngageSeek()
  • Called when a video seek was performed.

    Declaration

    Objective-C
    -(void)videoDidSeek;
    Swift
    funcvideoDidSeek()
  • Called when seek mode was disengaged.

    Declaration

    Objective-C
    -(void)videoDidDisengageSeek;
    Swift
    funcvideoDidDisengageSeek()
  • Called when video playback ends.

    Declaration

    Objective-C
    -(void)videoDidEnd;
    Swift
    funcvideoDidEnd()
  • Called when video playback encounters an error.

    Declaration

    Objective-C
    -(void)videoDidFailWithError:(nonnullNSError*)error;
    Swift
    funcvideoDidFailWithError(_error:Error)