| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 483 人关注过本帖
标题:帮助解决小问题!
只看楼主 加入收藏
冷月孤影
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2010-9-10
结帖率:0
收藏
已结贴  问题点数:20 回复次数:1 
帮助解决小问题!
以下为播放器JS文件
<!--
var curFile = "media/MM-9-1.WMV";
var vWidth = 320;
var vHeight = 245;
var vTitle = "


function pass2var(str){ //传递变量值函数。

  curFile = document.getElementById('playlistname').value;

  alert("变量值为:"+curFile);

  }





function setMediaPlayerObject(){
if(!$("playerList")) return false;
if(!$("v_info")) return false;

var objHTML = ("<object id='MediaPlayer' codeBase='http://activex.,1,52,701 type=application/x-oleobject' width='"+vWidth+"' height='"+vHeight+"' classid=CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6 standby='Loading Microsoft? Windows Media? Player components...'>");
objHTML += ("<param name='URL' value='"+curFile+"'");
objHTML += ("<param name='AutoStart' value='1'>");
objHTML += ("<param name='rate' value='1'>");
objHTML += ("<param name='balance' value='0'>");
objHTML += ("<param name='currentPosition' value='0'>");
objHTML += ("<param name='defaultFrame' value=''>");
objHTML += ("<param name='playCount' value='1'>");
objHTML += ("<param name='currentMarker' value='0'>");
objHTML += ("<param name='invokeURLs' value='-1'>");
objHTML += ("<param name='baseURL' value=''>");
objHTML += ("<param name='volume' value='50'>");
objHTML += ("<param name='mute' value='0'>");
objHTML += ("<param name='uiMode' value='none'>");
objHTML += ("<param name='stretchToFit' value='1'>");
objHTML += ("<param name='windowlessVideo' value='0'>");
objHTML += ("<param name='enabled' value='-1'>");
objHTML += ("<param name='enableContextMenu' value='0'>");
objHTML += ("<param name='fullScreen' value='0'>");
objHTML += ("<param name='SAMIStyle' value=''>");
objHTML += ("<param name='SAMILang' value=''>");
objHTML += ("<param name='SAMIFilename' value=''>");
objHTML += ("<param name='captioningID' value=''>");
objHTML += ("<param name='enableErrorDialogs' value='0'>");
objHTML += ("<param name='_cx' value='8467'>");
objHTML += ("<param name='_cy' value='8467'>");
objHTML += ("<param name='AutoSize' value='1'>");
objHTML += ("</object>");

$("playerList").innerHTML = objHTML;
$("v_info").innerHTML = vTitle;
$("MediaPlayer").controls.Stop();
$("perpic").style.display='block';
$("playerList").style.display='none';
$("Play").src="mediaplayer/lightblue/p_play.gif";
$("mediaInfo").innerHTML="<a href='javascript:void pass2var();' class='cWhite' id='playlistname' value='media/123.mpg'>冰霜龙坐骑演式</a>";

}

setOnloadEvent(setMediaPlayerObject);
//-->


如果通过点击下链接在不刷新页面的情况下播放value路径的视频.
<a href='javascript:void pass2var();' class='cWhite' id='playlistname' value='media/123.mpg'>冰霜龙坐骑演式</a>
搜索更多相关主题的帖子: 播放器 function return false media 
2010-09-10 16:32
foktime
Rank: 11Rank: 11Rank: 11Rank: 11
来 自:奥斯维辛
等 级:贵宾
威 望:35
帖 子:795
专家分:2742
注 册:2009-9-4
收藏
得分:20 
程序代码:
function pass2var(str) { //传递变量值函数。
            curFile = document.getElementById('playlistname').value;

            var objHTML = ("<object id='MediaPlayer' codeBase='http://activex.,1,52,701 type=application/x-oleobject' width='" + vWidth + "' height='" + vHeight + "' classid=CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6 standby='Loading Microsoft? Windows Media? Player components...'>");
            objHTML += ("<param name='URL' value='" + curFile + "'");
            objHTML += ("<param name='AutoStart' value='1'>");
            objHTML += ("<param name='rate' value='1'>");
            objHTML += ("<param name='balance' value='0'>");
            objHTML += ("<param name='currentPosition' value='0'>");
            objHTML += ("<param name='defaultFrame' value=''>");
            objHTML += ("<param name='playCount' value='1'>");
            objHTML += ("<param name='currentMarker' value='0'>");
            objHTML += ("<param name='invokeURLs' value='-1'>");
            objHTML += ("<param name='baseURL' value=''>");
            objHTML += ("<param name='volume' value='50'>");
            objHTML += ("<param name='mute' value='0'>");
            objHTML += ("<param name='uiMode' value='none'>");
            objHTML += ("<param name='stretchToFit' value='1'>");
            objHTML += ("<param name='windowlessVideo' value='0'>");
            objHTML += ("<param name='enabled' value='-1'>");
            objHTML += ("<param name='enableContextMenu' value='0'>");
            objHTML += ("<param name='fullScreen' value='0'>");
            objHTML += ("<param name='SAMIStyle' value=''>");
            objHTML += ("<param name='SAMILang' value=''>");
            objHTML += ("<param name='SAMIFilename' value=''>");
            objHTML += ("<param name='captioningID' value=''>");
            objHTML += ("<param name='enableErrorDialogs' value='0'>");
            objHTML += ("<param name='_cx' value='8467'>");
            objHTML += ("<param name='_cy' value='8467'>");
            objHTML += ("<param name='AutoSize' value='1'>");
            objHTML += ("</object>");

            $("playerList").innerHTML = objHTML;
}
可以考虑把
            objHTML += ("<param name='AutoStart' value='1'>");
            objHTML += ("<param name='rate' value='1'>");
            objHTML += ("<param name='balance' value='0'>");
            objHTML += ("<param name='currentPosition' value='0'>");
            objHTML += ("<param name='defaultFrame' value=''>");
            objHTML += ("<param name='playCount' value='1'>");
            objHTML += ("<param name='currentMarker' value='0'>");
            objHTML += ("<param name='invokeURLs' value='-1'>");
            objHTML += ("<param name='baseURL' value=''>");
            objHTML += ("<param name='volume' value='50'>");
            objHTML += ("<param name='mute' value='0'>");
            objHTML += ("<param name='uiMode' value='none'>");
            objHTML += ("<param name='stretchToFit' value='1'>");
            objHTML += ("<param name='windowlessVideo' value='0'>");
            objHTML += ("<param name='enabled' value='-1'>");
            objHTML += ("<param name='enableContextMenu' value='0'>");
            objHTML += ("<param name='fullScreen' value='0'>");
            objHTML += ("<param name='SAMIStyle' value=''>");
            objHTML += ("<param name='SAMILang' value=''>");
            objHTML += ("<param name='SAMIFilename' value=''>");
            objHTML += ("<param name='captioningID' value=''>");
            objHTML += ("<param name='enableErrorDialogs' value='0'>");
            objHTML += ("<param name='_cx' value='8467'>");
            objHTML += ("<param name='_cy' value='8467'>");
            objHTML += ("<param name='AutoSize' value='1'>");
            objHTML += ("</object>");
这一大块不变的内容拿到外面来赋给一个变量,下面两个方法里用的的时候直接连接上这个字符串就行了
2010-09-13 11:15
快速回复:帮助解决小问题!
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.027044 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved