流动播放器的嵌套条件语句

时间:2013-04-06 07:08:49

标签: javascript html

为什么下面提到的代码不起作用?

<script>
flowplayer("player", "flowplayer-3.2.8.swf", {
    onLoad: function() { 
        this.setVolume(100); 
    },
    clip: {   
        autoBuffering: true,  
    },
var screenwidth = screen.width;
var screenheight = screen.height;
if (screenwidth / screenheight < 1.34) {
    <!--[if IE]>
         <plugins: {
     controls: null
     }/>
    <![endif]-->
    <!--[if !IE]><!-->
         <plugins: {
     controls: true
     }/>
    <!--<![endif]-->
});
</script>

3 个答案:

答案 0 :(得分:0)

 flowplayer("player", "flowplayer-3.2.8.swf", {

        onLoad: function() { 
            this.setVolume(100); 
        },
        clip: {   
            autoBuffering: true,
    url: video_path  
        },

here video_path is the path of your video

答案 1 :(得分:0)

你可以试试这个:

 <?php
   echo '<a href="'.{VIDEO PATH HERE}.'" style="display:block;width:631px;height:361px" id="player">  </a>';
   echo '<script>
          flowplayer("player", "http://releases.flowplayer.org/swf/flowplayer-3.2.15.swf", {  
             \'plugins\': {
             \'sharing\': {
             \'url\': \'http://releases.flowplayer.org/swf/flowplayer.sharing-3.2.10.swf\',

             \'buttons\': {
             \'overColor\': \'#ff0000\'
         },
         \'email\': {
             \'subject\': \'A cool video\'
         },
         \'embed\': {
             \'fallbackUrls\': [ \'Extremists.mov\' ]
         },

         \'facebook\': {
             \'shareWindow\': \'_popup\'
         },

         \'twitter\': true
         },
         \'dock\': {
             \'right\': 15,
             \'horizontal\': false,
             \'width\': \'10%\',
             \'autoHide\': false
         }
      },
      clip:  {
         autoPlay: false,
         autoBuffering: true
      }
   });
  </script>';
 ?>

答案 2 :(得分:0)

感谢您的评论,Dolours。我已经在我的项目文件中添加了flowplayer但是没有把它包含在这里,因为我认为它是假设的。这是我的标题中出现的内容;

<script src="http://www.dyslexiaservices.com.au/new/flowplayer-3.2.8.min.js"></script>

如果您删除“剪辑”下面的所有内容,代码可以正常工作,有或没有视频路径(我已尝试过两者)。问题似乎与条件IE语句有关。