在html中,这一行成功加载了我硬盘中的本地avi
<embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" name="mediaplayer1" ShowStatusBar="true" width="1280" height="720" src="fe.avi" autostart="false"
问题是我想加载相同的文件,但是在父目录中。所以,你说,../会起作用,但它没有。一旦文件(fe.avi)被转移,当前行使播放器出现,但屏幕保持黑色:
<embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" name="mediaplayer1" ShowStatusBar="true" width="1280" height="720" src="../fe.avi" autostart="false"
答案 0 :(得分:2)
相对路径完美无缺。
我尝试了src="../2.avi"
或src="../test/1.avi"
- 找到并播放了视频(不需要base
属性 - 它默认为&#39;。&#39;)。
但起初它只适用于IE9;在Crome&amp; Firefox我得到了玩家应该在的黑色区域。
我注意到Chrome正在尝试使用VLC媒体播放器插件而不是Windows Media播放器插件。
我发现无法使用WMP插件with the latest chrome:
如果您运行的是Windows 7,并且您的Chrome浏览器是33或更新版本,则该扩展程序将无效
不知道Firefox和WMP有什么问题 - 在设置页面上,所有设置都映射到WMP,但Firefox也使用VLC插件。
将VLC更新到最新版本后(我安装了v1。*) - Chrome和Firefox使用VLC插件播放视频,并且它们也适用于相对路径。
答案 1 :(得分:0)
如果要使用相对路径,则需要为其指定基本属性。例如,您的html位于“http://mytestsite.com/test”中。您的FLV文件位于“http://mytestsite.com/”中。所以你需要像这样添加基本属性
<embed
type="application/x-mplayer2"
pluginspage="http://www.microsoft.com/Windows/MediaPlayer/"
name="mediaplayer1"
ShowStatusBar="true"
width="1280"
height="720"
autostart="false"
base="http://mytestsite.com"
src="Sample.flv" />
有关详细信息,请Go through this LINK
答案 2 :(得分:0)
给它一条绝对的道路为我工作。
<embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/"
name="mediaplayer1" ShowStatusBar="true" width="1280" height="720" src="C:\Users\User\Desktop\testvideo.mp4" autostart="false">
你也可以这样做:
<embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/"
name="mediaplayer1" ShowStatusBar="true" width="1280" height="720" src="http://www.yoursite.com/downloads/20131205_104200.mp4" autostart="false">