Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

.EMBED_PLAYER_ADDED_TO_DOM

This event is dispatched when an embed player was added to the DOM, but not yet fully initialized. 

How to subscribe?

Code Block
languagejs
themeDJango

TouchCastPlayerAPI.Event.subscribe(TouchCastPlayerAPI.events.EMBED_PLAYER_ADDED_TO_DOM, callback);


Example of the e callback argument

Code Block
languagejs
themeDJango

{
	type:"PLAYER_EMBED_PLAYER_ADDED_TO_DOM",
   	data:{
		videoUrl:"//touchcast.com/files/44df4sdfs55erw444wefw1", // the url of the touchcast video
    	playerId:"player_01" // the unique player id that was set when the player was embedded
	}
}


.EMBED_PLAYER_FULLY_READY

This event is dispatched when an embed player is fully initialized and ready to be used. At this stage is safe to use the TouchCastPlayerAPI.doAction() method. 

How to subscribe?

Code Block
languagejs
themeDJango

TouchCastPlayerAPI.Event.subscribe(TouchCastPlayerAPI.events.EMBED_PLAYER_FULLY_READY, callback);


Example of the e callback argument

Code Block
languagejs
themeDJango

{
	type:"PLAYER_EMBED_PLAYER_FULLY_READY",
   	data:{
		videoUrl:"//touchcast.com/files/44df4sdfs55erw444wefw1", // the url of the touchcast video
    	playerId:"player_01" // the unique player id that was set when the player was embedded
	}
}


.VIDEO_PLAYED

This event is dispatched when an embed player has started playback, even if it's for the very first time or just a simple resume. 

How to subscribe?

Code Block
languagejs
themeDJango

TouchCastPlayerAPI.Event.subscribe(TouchCastPlayerAPI.events.VIDEO_PLAYED, callback);


Example of the e callback argument

Code Block
languagejs
themeDJango

{
	type:"PLAYER_VIDEO_PLAYED",
   	data:{
		videoUrl:"//touchcast.com/files/44df4sdfs55erw444wefw1", // the url of the touchcast video
    	playerId:"player_01" // the unique player id that was set when the player was embedded
	}
}


.VIDEO_PAUSED

This event is dispatched when an embed player has paused playback. 

How to subscribe?

Code Block
languagejs
themeDJango

TouchCastPlayerAPI.Event.subscribe(TouchCastPlayerAPI.events.VIDEO_PAUSED, callback);


Example of the e callback argument

Code Block
languagejs
themeDJango

{
	type:"PLAYER_VIDEO_PAUSED",
   	data:{
		videoUrl:"//touchcast.com/files/44df4sdfs55erw444wefw1", // the url of the touchcast video
    	playerId:"player_01" // the unique player id that was set when the player was embedded
	}
}


.VIDEO_ENDED

This event is dispatched when an embed player has finished playback and reached video end. 


How to subscribe?

Code Block
languagejs
themeDJango

TouchCastPlayerAPI.Event.subscribe(TouchCastPlayerAPI.events.VIDEO_ENDED, callback);


Example of the e callback argument

Code Block
languagejs
themeDJango

{
	type:"PLAYER_VIDEO_ENDED",
   	data:{
		videoUrl:"//touchcast.com/files/44df4sdfs55erw444wefw1", // the url of the touchcast video
    	playerId:"player_01" // the unique player id that was set when the player was embedded
	}
}


.TIME_UPDATE

This event is dispatched during playback of an embed player. Use this to track playback time. 


How to subscribe?

Code Block
languagejs
themeDJango

TouchCastPlayerAPI.Event.subscribe(TouchCastPlayerAPI.events.TIME_UPDATE, callback);


Example of the e callback argument

Code Block
languagejs
themeDJango

{
	type:"PLAYER_TIME_UPDATE",
   	data:{
		videoUrl:"//touchcast.com/files/44df4sdfs55erw444wefw1", // the url of the touchcast video
    	playerId:"player_01" // the unique player id that was set when the player was embedded
	}
}