
Loading New Playlists ... problem
Hi,
I'll try to do the same thing as it's post here: https://developer.jwplayer.com/jw-player/demos/basic/loading-new-playlists/ but I fail.
Here is my code:
First:
<script src="https://content.jwplatform.com/libraries/GswCDm6y.js"></script>
In my page, I would like that visitor can change the playlist by clicking links in menu with <ul><li>:
<ul class="menuCombo">
<li class="item1"><a href="#">Genres</a>
<ul id="firstmenu">
<li class="subitem1"><a href="javascript:loadPlaylist(playlistOne)">Institutionnel</a></li>
<li class="subitem2"><a href="javascript:loadPlaylist(playlistTwo)">Bandes Annonces</a></li>
<li class="subitem3"><a href="javascript:loadPlaylist(playlistThree)">Publicités</a></li>
</ul>
</li>
</ul>
Here are my scripts:
<!-- Player JWPLAYER: Initial Playlist , there is a first playlist who plays when we arrive at the page and I use a Json link -->
<script type="text/javascript">
jwplayer("mediaplayer").setup({
"playlist": "https://cdn.jwplayer.com/v2/playlists/lMeqEfxa"
});
</script>
<!-- Here I copy the code of the tuto and I would like to use Json links too. As that doesn't work, I tried with different syntax -->
<script type="text/javascript">
//Define our three playlist arrays
var playlistOne = [{
"playlist":"https://cdn.jwplayer.com/v2/playlists/e1XLOaCH"}];
var playlistTwo = [{
"https://cdn.jwplayer.com/v2/playlists/e1XLOaCH"
}];
var playlistThree = "https://cdn.jwplayer.com/v2/playlists/e1XLOaCH";
//Create a function to load a playlist var
function loadPlaylist(thePlaylist) {
jwplayer("mediaplayer").load(thePlaylist)
};
</script>
Here is the webpage:
http://www.hervelacroix.com/testNewPlaylist.php
Thanks for your help.