You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
player.on("stateChange",function(event){// event.data is the state});player.on("stateChange:playing",function(event){// some events support filtering. });player.once("playheadUpdate:20",function(event){// this works like a cue point, firing at 20 seconds, but only one time since `once` was used.});player.one("playheadUpdate:20",function(event){// the one method only fires once.});
The callback's argument has the following three properties:
type: The type of event
target: The player that dispatched the event
data: An optional property that contains data about the event.
An events object can also be passed into the constructor, or defined on PJS.defaultEvents.
varevents={mediaStart:function(event){// event.target equals the player that dispatched the event.},metadata:function(event){// event.data is the metadata or other data depending on the event.}};varplayer=newPJS.Player($(".videoPlayer")[0],{uri:12345},events);