Skip to main content

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:

  1. In ViewController.h or ViewController.swift, create a VPPlayer object named vpPlayer.

  2. Call the setup function

let vpplayer: VPPlayer = VPPlayer(container: player_container)
  1. 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 or lxxxxxx
  • PlayerId in the playerId parameter of format: pxxxxxxx

Parameters and Types

ParameterDescriptionType
idVideo Id or Playlist IdString
playerIdPlayer IdString
playerContainerContainer where player will be shown.UIView