Add player to your view

Use the following steps and code examples to add a player to the ViewController.h or ViewController.swift file of your app:

  • In ViewController.h or ViewController.swift import BridSDK
  • Declare a variable BVPlayer named player
#import "ViewController.h"
#import <BridSDK/BridSDK.h>
  
@interface ViewController ()

@property (nonatomic) BVPlayer *player;

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
  	player = [[BVPlayer alloc] initWithData:[[BVData alloc] initPlayerID:<int> forVideoID:<int>] forView:<UIView>]
    
}

@end
import UIKit
import BridSDK

class ViewController: UIViewController {
    
    var player: BVPlayer?

    override func viewDidLoad() {
        super.viewDidLoad()
				player = BVPlayer(data: BVData(playerID: <Int32>, forVideoID: <Int32>), for: <UIView>)	
    }


}

What’s Next