/*
 * This is a sample code to illustrate how to create an instance of the RBX video player!
 */
<div>
	// ----------------------------------------------------
	// -- DOM elements for the RBX video player          --
	// ----------------------------------------------------
	
// ---------------------------------------------------- <script> let player1 = null, skeleton = null; // -------------------------------------------------------------------------------------------- // After the RBX player library is ready create a player instance // -------------------------------------------------------------------------------------------- const videoParams = { videoId: 'rrn:content:live-videos:f78d203c-218b-54d9-a557-766b504bf2cc:en-INT' autostart: false, cornerbug: true, localeMix: 'en-US>en-INT', embedcode: true, sharingenabled: true, muted: false, // autoplay: false // Autoplay initial value // showplaylist: true, // True by default // showtabs: true, // False by default // showschedule: true, // False by default // showcuetag: true // False by default mode: 'live', // live, vod, story phasing: true, // enable phasing in the player iframe: false, // enable phasing for iframe embeds }; const startSkeleton = () => { RBUP.RBXPlayer.createSkeleton("#rbx-player1-container", videoParams).then(player => { skeleton = player; }); } const startVideos = () => { RBUP.RBXPlayer.create("#rbx-player1-container", videoParams).then(player => { skeleton.destroy(); player1 = player; player.on(player.EVENTS.ON_VIDEO_LOADED, () => { // Your logic here console.log('getVidMeta() =>', player1.getVidMeta('vidID')); console.log('getVidMeta() =>', player1.getVidMeta('videoUrl')); console.log('getVidMeta() =>', player1.getVidMeta()); }); player.on(player.EVENTS.ON_PLAYING, () => { // Your logic here }); player.on(player.EVENTS.ON_PAUSED, () => { // Your logic here }); player.on(player.EVENTS.ON_RBX_PLAYLIST_ITEM_CLICKED, (e) => { // "e" will contain the videoId }); player.on(player.EVENTS.ON_RBX_PLAYER_LOADED, (params) => { // "params" will contain the event object }); player.on(player.EVENTS.ON_FIRST_FRAME, (params) => { // "params" will contain the event object }); // player.load('AP-1M5Y22GTW2111'); OR // player.load('rrn:content:videos:b136436a-dc1c-4fbd-9eaa-7e654fa5c53e:it-IT'); OR player.load(); }); } // -------------------------------------------------------------------------------------------- // Register the event listener to detect when the RBX video player library is ready to be used // -------------------------------------------------------------------------------------------- window.addEventListener('rbPlyrInstalled', startVideos); // UP Player is ready (takes longer) window.addEventListener('rbxPlayerInstalled', startSkeleton); // RBX Player ready (faster) // -------------------------------------------------------------------------------------------- // -------------------------------------------------------------------------------------------- // Example of how to play a new video // -------------------------------------------------------------------------------------------- const playNewVideo = () => { const parameters = { autostart: true, showvideotitle: false, cornerbug: false, localeMix: 'en-US>en-INT', sharingenabled: false, showplaylist: false, }; player1.load('AP-1VVBJFMJS1W11', parameters); }; </script> </div> <script async src="https://unifiedplayer-rbx.herokuapp.com/bundle.js"></script>