Setup the player
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, create a VPPlayer object named vpPlayer.
Call the setup function
let vpplayer: VPPlayer = VPPlayer(container: player_container)
- Setup video
vpplayer.set(id: "vxxxxxxx", playerId: "pxxxxxxx")
Configuration
You can setup the player by using:
- VideoId or PlaylistId in the id parameter of format:
vxxxxxx
orlxxxxxx
- PlayerId in the playerId parameter of format:
pxxxxxxx
Parameters and Types
Parameter | Description | Type |
---|---|---|
id | Video Id or Playlist Id | String |
playerId | Player Id | String |
playerContainer | Container where player will be shown. | UIView |