Я пытаюсь встроить JW-плеер в мой сайт При попытке воспроизвести видео появляется сообщение «Видео не найдено или доступ запрещен». - PullRequest
0 голосов
/ 27 июня 2011

Вот мой код:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-    strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
  <head>
    <title>SWFObject dynamic embed - step 1</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
     <script type="text/javascript" src="swfobject/swfobject.js"></script>
     <script type="text/javascript" src="jwplayer/jwplayer.js"></script>  

  </head>
  <body>

    <div id="flashContent">
      <p>Alternative content</p>
    </div>

    <script type="text/javascript">
    var flashvars = { file:'/video.flv'};
    var params = { allowfullscreen:'true', allowscriptaccess:'always' };
    var attributes = { id:'player1', name:'player1' };

    swfobject.embedSWF('player1.swf','flashContent','480','270','9.0.115','false', flashvars, params, attributes, flashLoaded);

function flashLoaded(e) {
 // e.ref is a reference to the Flash object. We'll pass it to jwplayer() so the API knows where the player is.

 // Add event listeners
 jwplayer(e.ref).onReady(function() { alert('Player is ready'); e.ref.play();e.ref.seek(10); });
 jwplayer(e.ref).onPlay(function() { e.ref.play();});
 jwplayer(e.ref).onStop(function() { e.ref.stop();});
 jwplayer(e.ref).onVolume(function() { e.ref.seek(100);});
 // Interact with the player
 }

 </script>

 </body>
</html>

'video.flv' находится в том же каталоге, что и HTML-файл

1 Ответ

0 голосов
/ 27 апреля 2013

попробуй поставить полный путь например:

var flashvars = {file: 'http://yourwebsite.com/video.flv'};

...