![](https://secure.gravatar.com/avatar/06aacb2f1dbed200347db0a003fc6179?rating=PG&size=50&default=https%3A%2F%2Fcdn.desk.com%2Fassets%2Funknown_user_50-8ad5644bbe6b1bd7454f2ea465f782bd.png)
Help changing video source in java script
I am working to convert our code to support the JW Player 6 (from v5). I am having trouble getting the java script to change video source. The function is triggered when the user clicks a button on the browser.
I'm pretty sure it's in this line:
bc.. .
var toplay= "file: 'http://<%=node%>.<%=dc %>.OurWowzaServer.net:1935/<%=PubPoint %>' + '/smil:' + Channel + '.smil/playlist.m3u8'";
but not sure exactly how to fix. Can anyone advise please? thank you
bc.. <script type="text/javascript">
jwplayer('mediaplayer').setup({
'id': 'playerID',
'width': '720',
'height': '410',
'controlbar': 'over',
'autostart': 'true',
'live': 'true',
'file': 'http://<%=node%>.<%=dc %>.OurWowzaServer.net:1935/<%=PubPoint %>/smil:<%=Feed %>.smil/playlist.m3u8'
});
function ChangeVideo(Channel) {
var element = document.getElementById('mediaplayer');
var toplay= "file: 'http://<%=node%>.<%=dc %>.OurWowzaServer.net:1935/<%=PubPoint %>' + '/smil:' + Channel + '.smil/playlist.m3u8'";
jwplayer(element).load(toplay);
jwplayer(element).play();
}
</script>