JSFiddle - React, Tailwind, and code Playground

by scurrilus

HTML

<video id="video-5854481866001" data-account="4332409863001" data-player="ByGdadQZ2e" data embed="default" class="video-js" playsinline data-video-id="5854481866001" preload="metadata"></video>
<script>
	bcPlayer("video-5854481866001");
</script>

<br>

<video id="video-5841850399001" data-account="4332409863001" data-player="ByGdadQZ2e" data embed="default" class="video-js" playsinline data-video-id="5841850399001" preload="metadata"></video>
<script>
		bcPlayer("video-5841850399001");
</script>

JavaScript

function bcPlayerApi(arg, callback) {
  console.log('--- 2 ---hello from A, ' + arg + ' called me');
  callback('function A');
}

function bcPlayerLoad(arg, callback) {
  console.log('--- 4 ---hello from A, ' + arg + ' called me');
  callback('function A');
}

function bcPlayer(arg) {
  console.log('--- 1 --- hello from Init, ' + arg);
  bcPlayerApi('Function Init', (arg) => {
    console.log('--- 3 --- I am last in the chain and called from ', arg);
  });
	
	bcPlayerLoad('Function load', (arg) => {
    console.log('--- 5 --- I am last in the chain and called from ', arg);
  });
}