如何在此代码中添加高清视频文件?高清插件已启用。我经历了他们的documentations。但是没有得到我如何在这段代码中实现它。

<script type='text/javascript' src='swfobject.js'></script>

<div id='mediaspace'>This text will be replaced</div>

<script type='text/javascript'>
  var so = new SWFObject('player.swf','mpl','470','320','9');
  so.addParam('allowfullscreen','true');
  so.addParam('allowscriptaccess','always');
  so.addParam('wmode','opaque');
  so.addVariable('file','sample.mp4');
  so.addVariable('plugins','hd-1');
  so.write('mediaspace');
</script>

最佳答案

好吧,我发现了。

<script type="text/javascript">
        var flashvars = {
                'file':                 'sd-video.mp4',

                'hd.file':              'hd-video.mp4',
                'hd.state':             'true'
        };
        var params = {

                'allowfullscreen':      'true',
                'allowscriptaccess':    'always',
                'bgcolor':              '#ffffff'

        };
        var attributes = {
                'id':                   'player1',

                'name':                 'player1'
        };
        SWFObject.embedSWF('player.swf', 'flashContent', '300', '250', '9', 'false', flashvars, params, attributes);

</script>


就我而言,我可以像这样引用高清视频:

<script type='text/javascript' src='swfobject.js'></script>

<div id='mediaspace'>This text will be replaced</div>

<script type='text/javascript'>
  var so = new SWFObject('player.swf','mpl','470','320','9');
  so.addParam('allowfullscreen','true');
  so.addParam('allowscriptaccess','always');
  so.addParam('wmode','opaque');
  so.addVariable('file','sample.mp4');//reference to sd video.
  so.addVariable('hd.file','hd_sample.mp4');//reference to the hd version of video.
  so.addVariable('hd.state','true'); //too choose hd as default.
  so.addVariable('plugins','hd-1');
  so.write('mediaspace');
</script>

10-08 11:59