Hi,
I have a problem with a secure token in a player. In my case, my code looks as follows:
<div id="wowza_player" ></div>
<script type="text/javascript">
var myPlayer = WowzaPlayer.create("wowza_player",
{
"license":"PLAY2-49nKb-TjeXx-xxxxxx-xxxxxx-xxxxxx",
"sources":[{
"sourceURL":"https://cdn3.wowza.com/1/xxxxxxx/xxxxxxx/hls/live/playlist.m3u8?<?php echo $token;?>"
},
{
"sourceURL":""
}],
"title":"xxxxxxxxxxxxxxx",
"description":"",
"autoPlay":true,
"mute":false,
"volume":75,
"posterFrameURL":"https://xxxxxxxxxx.de/player_preview.jpg",
"withCredentials":"true"
}
);
</script>
As you can see, the security token is generated with PHP. The token is valid for 3 seconds.
Usually the autoplay function is active. But if the browser is disabling the autoplay and the user pressed the big or small play button, the token is not valid any more.
Now, I want to update the sourceURL when the user clicks play.
I tried this code, but it doesn´t work:
myPlayer.onPlay( updateSecret(); );
So, what is the right code for catching the play event?
Thanks in advance.