Linear

Playlist Swap in one player (Projekktor Core)

by ๋JACK, Saturday, August 25, 2012, 08:29 (751 days ago)

How to create the playlist switch button?
Can you advice about JS code?
May be about .setFile , please give me some guideline or example code for this.
Thanks!

  923 views

Playlist Swap in one player

by JACK, Saturday, August 25, 2012, 08:34 (751 days ago) @ ๋JACK

Here is my code. What i want is to swap new playlist into this player.

<script type="text/javascript">
$(document).ready(function() {
      var currentMovie = 0;
      
      // Define event functions
      var MovieChanged = function(data) {
        $('#video'+currentMovie).toggleClass('active');
        $('#video'+data).toggleClass('active');
        currentMovie = data;
      }
      var ChangeMovie = function(data) {
        if (data != currentMovie) {
          projekktor('videoPlayer').setActiveItem(data);
        }
        return false;
      }
      
      // player's OnReady function, adds event listeners
      var PlayerReady = function(player) {
        player.addListener('item', MovieChanged);
        
        $('#video0').click(function() {ChangeMovie(0);});
        $('#video1').click(function() {ChangeMovie(1);});
        $('#video2').click(function() {ChangeMovie(2);});
        $('#video3').click(function() {ChangeMovie(3);});
		
        $('#video0').toggleClass('active');
        
        $('#link').click(function() {player.setPause();});
      }
      
      // Instanciate player
      projekktor('#videoPlayer', {
        controls: true,
        width: 700,
        height: 400,
        autoplay: false,
        playerFlashMP4: 'http://movie.javoclub.com/jarisplayer.swf',
        playerFlashMP3: 'http://movie.javoclub.com/jarisplayer.swf',
		plugin_display: {
           logoImage: "http://movie.javoclub.com/theme/logo_javohd.png",  
     logoDelay: 1,
  logoPosition:"tr"
 },
        playlist: [
		  { // JAVO Title
            0:{src:'http://movie.javoclub.com/banner/preplay.jpg', type: 'image/jpeg'},
            config:{poster:'http://movie.javoclub.com/theme/playpage.jpg', title:"JAVO MOVIE", duration:"2"}
          },		
          { // Part 1
            1:{src:'http://javoclub.com/bWVkaWE=/asd-01.mp4', type: 'video/mp4'},
            config:{title:"xxx: Part 1"}
          },
          { // Part 2
            2:{src:'http://javoclub.com/bWVkaWE=/asd-02.mp4', type: 'video/mp4'},
            config:{title:"xxx: Part 2"}
          },
          { // Part 3
            3:{src:'http://javoclub.com/bWVkaWE=/asd-03.mp4', type: 'video/mp4'},
            config:{title:"xxx: Part 3"}
          },		  		  		  
        ]
      }, PlayerReady);
    });
  </script>

<br />
<div id="videoPlayer" class="projekktor"></div>
<br />	

 <div id="partmodule"><!--part select area-->
   <ul class="video-thumbs">
    <li><a title='part1' href='#1' id="video1"><img src='http://i.imgur.com/Qy0iO.jpg' width='130' height='71' alt=''><span class='play'></span><div class='icon-div'><span>part 1</span></div>
   </a>
   </li>
   <li><a title='part2' href='#2' id="video2"><img src='http://i.imgur.com/rjeTR.jpg' width='130' height='71' alt=''><span class='play'></span><div class='icon-div'><span>part 2</span></div>
   </a>
   </li>
   <li><a title='part3' href='#3' id="video3"><img src='http://i.imgur.com/kmSYy.jpg' width='130' height='71' alt=''><span class='play'></span><div class='icon-div'><span>part 3</span></div>
   </a>
   </li>
   </ul>
   </div>
  1075 views