It is possible to implement a callback function, which executes code as soon as a player is loaded. You can hand over the function name that is called when loading the public API of the respective player.
Sample
Panel | ||
---|---|---|
| ||
<!DOCTYPE html>
<html>
<head>
<script src="//e-qa.video-cdn.net/v2/embed.js"></script>
</head>
<body>
<div id="1234"></div>
<script type="text/javascript">
var playerProps = {
success: function(playerApi){
playerApi.play();
playerApi.forward(20000);
playerApi.toggleMute();
}
};
loadPlayer = function () {
var element = document.getElementById('1234');
var player = document.createElement('div');
player.setAttribute('mi24-video-player', '');
player.setAttribute('config-type', 'vmpro');
player.setAttribute('player-id', '8VLLFNqcTHfCq4LybMY_ha');
/*
elfriede: 8VLLFNqcTHfCq4LybMY_ha
bitmovin: 6MQNZF1mMy7ixzBk2VUqgb
*/
player.setAttribute('video-id', '8D92XrqyfB7M1_7cj9rdpN');
player.setAttribute('api-url', '//d-qa.video-cdn.net/play');
player.setAttribute('flash-path', '//e-qa.video-cdn.net/v2/');
element.appendChild(player);
VideoPlayer.Collection.addPlayerById('1234', playerProps);
};
</script>
<button onclick="loadPlayer()">load</button
<div mi24-video-player video-id="7TaeAERUQ4o7LcBp2Mww6e" player-id="22YWm2xuSoMa25RptjLJDU" config-type="vmpro" flash-path="//e-qa.video-cdn.net/v2/" api-url="//d-qa.video-cdn.net/play"></div><script src="//e-qa.video-cdn.net/v2/embed.js"></script>
</body>
</html> |
movingimage EVP GmbH | Copyright © 2005–2021 movingimage EVP GmbH. The product names mentioned may be registered trademarks of the relevant manufacturer. Video editing, video streaming, video hosting, live streaming, video galleries, video range, video ads, video SEO, video cloud for websites and everything as a cloud solution - no software installation necessary.