(Flash) Flowplayer 源代码 - 是否必须来自 http://?
我主要使用 jsvideo 作为 HTML5 视频,但它使用 flowplayer 作为其 flash 后备...我可以使用它,只是 flowplayer 使用的 swf 文件需要来自 http 源...有没有办法让它工作这样我就可以将文件放在我的服务器上吗?
更新:这是我使用的实际代码 - 在 Flash 后备部分中,我尝试直接引用 swf 媒体,但它不起作用。如果我引用 flowplayer.org/swf/flowplayer-3.2.1.swf ,它的唯一工作方式 “数据”, "param name="movie" value=" 和 "param name="flashvars" ... url"
$.fancybox({
'padding': 0,
'overlayOpacity': 0.7,
'autoDimensions': false,
'width': 650,
'height': 274,
'content': '<div><div class="video-js-box">' +
'<video id="example_video_1" class="video-js" width="640" height="264" controls="controls" preload="auto" poster="' + url + '.png">' +
'<source src="' + url + '.mp4" />' +
'<source src="' + url + '.webm" />' +
'<source src="' + url + '.ogv" />' +
'<!-- Flash Fallback. Use any flash video player here. Make sure to keep the vjs-flash-fallback class. -->' +
'<object id="flash_fallback_1" class="vjs-flash-fallback" width="640" height="264" type="application/x-shockwave-flash"' +
'data="/Content/media/flowplayer-3.2.1.swf">' +
'<param name="movie" value="/Content/media/flowplayer-3.2.1.swf" />' +
'<param name="allowfullscreen" value="true" />' +
'<param name="flashvars" value=\'config={"playlist":["' + url + '.png", {"url": "/Content/media/oceans-clip.mp4","autoPlay":false,"autoBuffering":true}]}\' />' +
'<!-- Image Fallback. Typically the same as the poster image. -->' +
'<img src="' + url + '.png" width="640" height="264" alt="Poster Image"' +
' title="No video playback capabilities." />' +
'</object>' +
'</video>' +
'</div></div>',
'onComplete': function () { $("#fancybox-inner").css({ 'overflow': 'hidden' }); },
'onClosed': function () { $("#fancybox-inner").empty(); }
});
您注意到 html5 视频的所有源都可以来自“/Content/media/name.mp4”,其中 swf 文件(特别是 flowplayer-3.2.1.swf 和“url”需要来自 http:// 源
(尽管我可以在本地引用 png 文件)
有什么办法解决这个问题吗?希望这是有道理的
I'm using jsvideo for primarly HTML5 video, but it uses flowplayer as its flash fallback...i have it working except that the swf files that flowplayer uses needs to come from an http souce...is there a way to make it so i can put the files on my server?
UPDATE: This is the actual code im using - in the flash fallback section ive tried to reference the swf media directly, and it doesnt work. Only way it works if i reference the flowplayer.org/swf/flowplayer-3.2.1.swf for
"data",
"param name="movie" value=" and "param name="flashvars" ... url"
$.fancybox({
'padding': 0,
'overlayOpacity': 0.7,
'autoDimensions': false,
'width': 650,
'height': 274,
'content': '<div><div class="video-js-box">' +
'<video id="example_video_1" class="video-js" width="640" height="264" controls="controls" preload="auto" poster="' + url + '.png">' +
'<source src="' + url + '.mp4" />' +
'<source src="' + url + '.webm" />' +
'<source src="' + url + '.ogv" />' +
'<!-- Flash Fallback. Use any flash video player here. Make sure to keep the vjs-flash-fallback class. -->' +
'<object id="flash_fallback_1" class="vjs-flash-fallback" width="640" height="264" type="application/x-shockwave-flash"' +
'data="/Content/media/flowplayer-3.2.1.swf">' +
'<param name="movie" value="/Content/media/flowplayer-3.2.1.swf" />' +
'<param name="allowfullscreen" value="true" />' +
'<param name="flashvars" value=\'config={"playlist":["' + url + '.png", {"url": "/Content/media/oceans-clip.mp4","autoPlay":false,"autoBuffering":true}]}\' />' +
'<!-- Image Fallback. Typically the same as the poster image. -->' +
'<img src="' + url + '.png" width="640" height="264" alt="Poster Image"' +
' title="No video playback capabilities." />' +
'</object>' +
'</video>' +
'</div></div>',
'onComplete': function () { $("#fancybox-inner").css({ 'overflow': 'hidden' }); },
'onClosed': function () { $("#fancybox-inner").empty(); }
});
You notice all the source for the html5 video can come from "/Content/media/name.mp4" where as the swf files (specifically the flowplayer-3.2.1.swf and "url" need to come from an http:// source
(although png files i can reference locally)
is there any way around this? hope this makes sense
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
由于您是从 flowplayer.org 域请求 SWF,因此您必须将引用作为绝对 HTTP 文件传递。
在 Flash 中,相对路径基于 提供 SWF 的目录(在本例中为
http://releases.flowplayer.org/swf/
),而不是基于包含嵌入 SWF 的 HTML 页面(即您的 HTML 页面)的目录。如果您想使用相对于服务器的相对路径,则需要在服务器上托管
flowplayer-3.2.1.swf
。使用绝对http
URI 链接到您的视频可能更容易。You'll have to pass the references as an absolute HTTP file since you are requesting the SWF from the flowplayer.org domain.
In Flash, relative paths are based on the directory the SWF is served from (in this case
http://releases.flowplayer.org/swf/
), not from the directory of containing the HTML page that embeds the SWF (i.e. your HTML page).If you want to use relative paths that are relative to your server, then you will need to host the
flowplayer-3.2.1.swf
on your server. It's probably easier to just link to your videos with absolutehttp
URIs.就像 gthmb 所说,你必须使用你的 SWF 目录。这是一个工作示例:
我必须使用“../”向上一个目录。 “工具”和“视频”目录位于同一级别。
Like gthmb said you have to use the directory of your SWF. Here is a working sample:
I have to use the "../" to go one directory up. The "Tools" and the "video" directory are on the same level.