Jump to content
php.lv forumi

JW Player strīmot no diviem dažādiem serveriem


Uplifting

Recommended Posts

Sveicināti!

 

Cenšos panākt JW Player strīmošanu no diviem dažādiem serveriem, respektīvi, caur PHP koda tiek ievadīts video faila nosaukums, šis video fails var atrasties gan uz "serveris1" gan uz "serveris2". Attiecīgi js kodā ir nepieciešams iemest divus linkus, pēc kuriem nosaka atrašanos vietu uz servera. Mans pašreizējais kods izskatās šādi:

 

 

 <script type="text/javascript">
    window.jw_jwpsrv_src="http://www.example.com/jwplayer/jwpsrv.js";
  </script>
  <script src="http://www.example.com/jwplayer/jwplayer.js?c=5"></script>
  <script>jwplayer.key="nCwRts+RO22OQ34vtgv+s23KGv4l5fPkV23G2k6frX1uyQ=="</script>  
  <script type="text/javascript">
    var assemble=function(o){
      $('<div id="'+o.id+'_inner"></div>').appendTo($('#'+o.id).html(''));
 
      jwplayer(o.id+'_inner').setup({
        file: 'http://108.162.207.49/videos/'+o.filename+'.mp4?r='+Math.random(),
        provider: "http",
        width: "640",
        height: "360",
        startparam: "start",
        'http.startparam':'start',
        analytics: {
            enabled:false
            ,cookies: false
        },
        primary:o.player_type
        ,autostart:o.autostart
        ,bufferlength:1 // buffer 1 second, to start playing
        ,logo:{
          file:'/logo.png'
          ,link:'http://www.example.com/'
        }
        ,abouttext:'© example '+new Date().getFullYear()
        ,aboutlink:'http://http://www.example.com/'
        // ,skin:'skins/brockskin8.zip'
      });
    }
  </script>  

 

Paldies!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...