Methods
We provide the following methods on our embedded Player application. In addition to the methods we provide, the getPlayer method will return an instance of a Video.js player which provides its own methods:
.launch
The launch method can also be thought of as a "setup" method. In it you provide the parameters you'd like to set the player with. The absolute basics needed to lauch a player are clientID and eventID. When you copy the Embed code snippet from the dashboard (be it a 24/7 Stream or an Event stream) it will come with all of the necessary properties. However there are a few extra properties you can use.
A basic embed will follow this format:
Invintus.launch({
clientID: <your Client Id>,
eventID: <Event Id>
});
Extra .launch Options
playerPrefID(Integer)
Used to provide an existing Player Preference other than the one that has been assigned through the Control Center.customID(String)
Your Event's CustomIDbasic(Boolean)
This will remove all features of the Player Preference and disply only a Video player. i.e. no Tabs, Title, Description, etc.autoStartStream(Boolean)
Will Auto Play events.
Note: Browser standards now require that all auto-played media be muted automatically. Our application does this for you.
Invintus.launch({
// ...
autoStartStream: true
});
startStreamAtandstopStreamAt(Integer)
These values are represented in terms of Seconds and will Start playback or Stop playback at a certain point.
Note: only applies to Published Events
Invintus.launch({
// ...
// start playback 1 minute into the event
startStreamAt: 60,
// Stop playback 2 minutes into the event
stopStreamAt: 120
});
streamReplace(Object)
You can initialize a player with a stream source other than that of a specific Events. To do this, initialize the application as follows:
Invintus.launch({
// ...
streamReplace: {
application: '//your.domain.com/applicaitonName/',
streamName: 'streamName'
}
});
.play
This will force the player to play. If it's already playing nothing will happen.
.pause
This will Pause the media if being played. If already paused nothing will happen
.seek(position)
Allows you to seek to a position in the Event in Seconds (Integer). Event must be published.
.destroy(forceUnmount, options)
Removes and cleans up the Player instance.
var playerNode = document.querySelctor("[data-eventid='YOUR_EVENT_ID']");
Invintus.destroy(
true,
{
MountNode: playerNode
}
);
.getPlayer(node)
Will return the Video.js instance of the player. If, however, you pass a DOM Node of an existing player, the function will return the instance of the Videojs Player mounted within that node.
Further Documentation: https://docs.videojs.com/
.getCurrentTime(node)
You can request the current Playback time (in seconds) by invoking this. If you have multiple Player embeds on the page you will need to provide the DOM node of the player.
Invintus.getCurrentTime();
// or
var playerNode = document.querySelctor("[data-eventid='YOUR_EVENT_ID']");
Invintus.getCurrentTime(playerNode);