iOS SDK Version
FBMediaView
Objective-C
@interfaceFBMediaView:UIView
Swift
classFBMediaView:UIView
The FBMediaView loads media content from a given FBNativeAd. This view takes the place of manually loading a cover image.
- the delegate
Declaration
Objective-C@property(nonatomic,weak,nullable)id<FBMediaViewDelegate>delegate;
Swiftweakvardelegate:FBMediaViewDelegate?{getset}
- A custom FBMediaViewVideoRenderer instance, used to override the default user experience of video ads. The video renderer can only be set prior to registering the mediaView to a nativeAd
Declaration
Objective-C@property(nonatomic,strong)FBMediaViewVideoRenderer*_NonnullvideoRenderer;
SwiftvarvideoRenderer:FBMediaViewVideoRenderer{getset}
- The current volume of the media view, ranging from 0.0 through 1.0.
Declaration
Objective-C@property(nonatomic,readonly)floatvolume;
Swiftvarvolume:Float{get}
- Shows if the video will autoplay or not
Declaration
Objective-C@property(nonatomic,readonly,getter=isAutoplayEnabled)BOOLautoplayEnabled;
SwiftvarisAutoplayEnabled:Bool{get}
- The aspect ratio of the media view visual 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 tag for media view. It always returns FBNativeAdViewTagMedia.
Declaration
Objective-C@property(nonatomic,readonly)FBNativeAdViewTagnativeAdViewTag;
SwiftvarnativeAdViewTag:FBNativeAdViewTag{get}
- Changes the width of the FBMediaView’s frame based on the current height, respecting aspectRatio.
Declaration
Objective-C-(void)applyNaturalWidth;
SwiftfuncapplyNaturalWidth()
- Changes the height of the FBMediaView’s frame based on the current width, respecting aspectRatio.
Declaration
Objective-C-(void)applyNaturalHeight;
SwiftfuncapplyNaturalHeight()