I included the viostream api js library on the head
of my project, so I can use the object viostreamPlayer
in js file:
<head>
...
<script src='https://publish.viostream.com/embed/api'></script>
</head>
I need to call embed
function twice in js and without reloading page. However, the second time to use the viostreamPlayer
would cause some problem.
Therefore, I would like to reload the api library before the second use. To make sure the viostreamPlayer
object fresh and ready to use.
More details:
I use the backbone.js
to load the video view in the page, and after another video view loaded by js, I should update the video content. That's why I need to call embed
function twice, which is to load another video. The new video is successfully embedded, but all the event handler failed. Load page by js cannot reload the head
.
The event handler is added by calling on
method with viostreamPlayer
:
viostreamPlayer.on('play', function(){})
But its out of work when I embedded the second video. That's why I am looking for the method to make sure the viostreamPlayer
fresh before calling embed
function.
Documentation: https://help.viostream.com/hc/en-us/articles/223291607-Embedding-and-using-the-Player-API
Cheers
Update
ViostreamPlayer has updated the api so the error is no longer existing.