player = [[BVPlayer alloc] initWithData: [[BVData alloc] initPlayerID:Int32 forVideoID:Int32] forView: <view>];
player = [[BVPlayer alloc] initWithData: [[BVData alloc] initPlayerID:Int32 forTag: @”” page:Int32 item:Int32] forView: <view>];
player = [[BVPlayer alloc] initWithData: [[BVData alloc] initPlayerID:Int32 forPlaylistID:Int32] forView: <view>];
player = [[BVPlayer alloc] initWithData: [[BVData alloc] initPlayerID:Int32 forLatestID:Int32] forView: <view>];
player = [[BVPlayer alloc] initWithData: [[BVData alloc] initPlayerID:Int32 forLatestID:Int32] forView: <view>];
Start video playback
[player play];
Pause video playback
[player pause];
Mute video.
[player mute];
Unmute video.
[player unmute];
Play previous video in playlist
[player previous];
Play next video in playlist.
[player next];
Stop playback.
[player stop];
Set player fullscreen.
[player setToFullscreen];
Set auto rotate to false (default true).
[player autoFullscreenWhenRotating];
Is video fullscreen.
Code | Return |
---|---|
[player isFullscreen] | Boolean (0,1) |
Is the player in View of Window or Superview, is the window hidden, or the player or superview, is it inside the bounds of the Window or Superview frame, is there any view in front of him and if they are overlaping.
Code | Return |
---|---|
[player isPlayerInView] | Boolean (0,1) |
Returns current video time
Code | Return |
---|---|
[player getCurrentTime] | Double |
Returns length of the video
Code | Return |
---|---|
[player getDuration] | Double |
Returns video muted boolean
Code | Return |
---|---|
[player getMuted] | Boolean (0,1) |
Returns volume of the video
Code | Return |
---|---|
[player getVolume] | Float |
Return if ad is in progress
Code | Return |
---|---|
[player isAdInProgress] | Boolean (0,1) |
Returns index of the video in the playlist
Code | Return |
---|---|
[player getCurrentIndex] | NSInteger |
Returns array of video objects
Code | Return |
---|---|
[player getPlaylist] | NSArray <VideoData> |
Returns URL of the current video file
Code | Return |
---|---|
[player getSource] | NSString |
Returns current video object
Code | Return |
---|---|
[player getVideo] | VideoData |
Sets volume of the video
Code | Type |
---|---|
[player setVolume:(float)] | Float |
Plays video with the set index in the playlist
Code | Type |
---|---|
[player playByIndex:(int)] | NSInteger |
Change current video source
Code | Type |
---|---|
[player setVideo:(VideoData)] | VideoData |
Change current video source URL
Code | Type |
---|---|
[player setVideoUrl:(string)] | NSString |
Sets playlist from JSON
Code | Type |
---|---|
[player setPlaylist:(url)] | NSURL |
Sets ad object for the next videos in the playlist
Code | Type |
---|---|
[player setAd:(Array |
NSArray |
Sets ad object for current video and plays it if (isAdInProgress == 0)
Code | Type |
---|---|
[player playAd:(AdData)] | AdData |
Sets ad URL for current video if (isAdInProgress == 0)
Code | Type |
---|---|
[player playAd:(url)] | NSURL |
Sets controls visibility autohide ON/OFF
Code | Type |
---|---|
[player autoHideControls] | Boolean (0,1) |
Player events which can be listened:
Notification.name = @”PlayerEvent” notification.userInfo = @“event”
[[NSNotificationCenter defaultCenter] addobserver:@selector(eventMethod:) name:@”PlayerEvent” object:nil];
- (void)eventMethod:(NSNotification *)notification {
if ([notification.name isEqualToString:@"PlayerEvent"]) {
NSLog(@"%@", (NSString *)notification.userInfo[@"event"]);
}
}
Ad events which can be listened
Notification.name = @”PlayerEvent” notification.userInfo = @“event”
[[NSNotificationCenter defaultCenter] addobserver:@selector(adMethod:) name:@”AdEvent” object:nil];
- (void)adMethod:(NSNotification *)notification {
if ([notification.name isEqualToString:@"AdEvent"]) {
NSLog(@"%@", (NSString *)notification.userInfo[@"adEvent"]);
}
}
adLoaded - This is actually Ad Request adStarted - This is actually Ad Impression adComplete adErrorAnalytics - adComplete - ad finished adError
Video object initialization
Source ✱source = [[Source alloc] init];
[source setSd:@”your video url”];
VideoData ✱videoObject = [[VideoData alloc] initWithVideo:@”id”
duration:@””
ageGateId:@””
name:@””
_description:@””
image:@””
thumbnail:@””
clickthroughUrl:@””
thumb:@””
publish:@””
mimeType:@””
webp:@””
monetize:@””
liveimage:@””
secureUrl:@””
source:(source)
tracks:(NSArray<Tracks>)];
Video object initialization
Mobile ✱mobile = [[Mobile alloc] initWithMobile:@”custom id” url:@”your ad url”];
NSMutableArray *mobileArray = [[NSMutableArray alloc] init];
[mobileArray addObject:mobile];
AdData *ad = [[AdData alloc] initWithAdType:@"roll type"
overlayStartAt:@""
overlayDuration:@""
adTimeType:@"s"
cuepoints:@""
mobile:mobileArray
[player setAdMacros: [[AdMacros alloc] initAdMacrosUserAgent:@""
referrerUrl:@""
pageUrl:@""
appStoreUrl:@""