开发者

(Flash) Flowplayer source - does it have to come from http://?

开发者 https://www.devze.com 2023-01-26 07:21 出处:网络
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

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, a开发者_开发技巧nd 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


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 absolute http URIs.


Like gthmb said you have to use the directory of your SWF. Here is a working sample:

<object type="application/x-shockwave-flash" data="/Tools/flowplayer-3.2.12.swf" width="600px" height="338px">
                            <param name="movie" value="Tools/flowplayer-3.2.12.swf">
                            <param name="allowFullScreen" value="true">
                            <param name="wmode" value="transparent">
                            <param name="flashVars" value="config={'playlist':['../Video/myVideo.jpg',{'url':'../Video/myVideo.mp4','autoPlay':false}]}">
                            <img src="video/myVideo.jpg" width="600px" height="480px"></object></video>

I have to use the "../" to go one directory up. The "Tools" and the "video" directory are on the same level.

0

精彩评论

暂无评论...
验证码 换一张
取 消