JPlayer playlist - need to move variable values from head to body

JPlayer playlist - need to move variable values from head to body

Hello

Please check the code below defined in the head tag.

I now need to move the myPlaylist.setPlaylist variable and from the head html tag into the body html tag., so I can change the playlist dynamically. Can you please advise?

Why? - I'm using a DNN module and injecting dynamic data. Unfortunately I can only inject data via tokens into the body and not the head.


Many Thanks...

  1. <link type="text/css" href="/script/jplayer/skin/pink.flag/css/jplayer.pink.flag.css" rel="stylesheet" />
  2. <script type="text/javascript" src="/script/jplayer/jplayer.playlist.min.js"></script>
  3. <script type="text/javascript" src="/script/jplayer/jquery.jplayer.min.js"></script>
  4. <script type="text/javascript">
  5. $(document).ready(function(){

  6. var myPlaylist = new jPlayerPlaylist({
  7. jPlayer: "#jquery_jplayer_1",
  8. cssSelectorAncestor: "#jp_container_1"
  9. },[], {
  10. swfPath: "/script/jplayer",
  11. supplied: "mp3",
  12. wmode: "window",
  13. useStateClassSkin: true,
  14. autoBlur: false,
  15. smoothPlayBar: true,
  16. keyEnabled: true
  17. });

  18. myPlaylist.setPlaylist([
  19. {
  20. title:"MYTitle",
  21. artist:"MYArtist",
  22. mp3: "/Portals/0/_audio/MYFile.mp3"
  23. }
  24. ]);


  25. });
  26. </script>