在嵌入式播放器中动态加载视频

时间:2015-03-20 19:15:05

标签: javascript

我的网页上有一个视频播放器:

<object id='mediaPlayerobj' width="320" height="285" 
                        classid='CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95' 
                        codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701'
                        standby='Loading Microsoft Windows Media Player components...' type='application/x-oleobject'>
                        <param id='movie' name='fileName' value="">
                        <param name='animationatStart' value='true'>
                        <param name='transparentatStart' value='true'>
                        <param name='autoStart' value="true">
                        <param name='showControls' value="true">
                        <param name='loop' value="true">
                        <embed type='application/x-mplayer2' 
                            pluginspage='http://microsoft.com/windows/mediaplayer/en/download/'
                            id='mediaPlayer' name='mediaPlayer' displaysize='4' autosize='-1' 
                            bgcolor='darkblue' showcontrols="true" showtracker='-1' 
                            showdisplay='0' showstatusbar='-1' videoborder3d='-1' width="320" height="285"
                            src="" autostart="true" designtimesp='5311' loop="true">
                        </embed>
                    </object>

我已将文件名值留空,因为我想动态设置它。我有一个网格视图,我加载了一个存储在我们服务器上的视频列表。我希望播放器从服务器加载电影。这是我的JavaScript:

var grid = document.getElementById('<%=gvPresentations.ClientID %>');
        var cell = grid.rows[(+index) + 1].cells[2].textContent;
        var path = "d:\\Presentations\\";
        document.getElementById('movie').value = path + cell;

但是当我更改文件名元素时没有任何反应。我错过了什么?

0 个答案:

没有答案