Currently, flvmediaplayer generates an embed code that looks a little like the following:
<object width="600" height="300">
<param name="bgcolor" value="#000000"></param>
<param name="height" value="300"></param>
<param name="width" value="600"></param>
<param name="allowfullscreen" value="true"></param>
<param name="quality" value="true"></param>
<param name="allowscriptaccess" value="always"></param>
<embed src="http://www.example.com/mediaplayer.swf" flashvars="background=#000000&frontcolor=#ffffff&lightcolor=#ffffff&screencolor=#000000&height=300&width=320&playlist=right&playlistsize=280&skin=http://www.example.com/skins/modieus.swf&repeat=none&stretching=fill&volume=90&file=http://www.example.com/xspf" width="600" height="300"></embed></object>
The problem here is that some attributes are missing from the tag, and only included as
elements. I don't think this is right. For one thing, 'allowfullscreen' needs to be set as an attribute on the tag, otherwise it just doesn't work (in Firefox on Linux anyway). The attached patch ensure that these params are also included as attributes on the embed object, thus ensuring that the user gets a fully functional embeded player from the embed code. After installing the patch, the above embed code would look more like this:
<object width="600" height="300">
<param name="bgcolor" value="#000000"></param>
<param name="height" value="300"></param>
<param name="width" value="600"></param>
<param name="allowfullscreen" value="true"></param>
<param name="quality" value="true"></param>
<param name="allowscriptaccess" value="always"></param>
<embed src="http://www.example.com/mediaplayer.swf" bgcolor="#000000" height="300" width="600" allowfullscreen="true" quality="true" allowscriptaccess="always" flashvars="background=#000000&frontcolor=#ffffff&lightcolor=#ffffff&screencolor=#000000&height=300&width=320&playlist=right&playlistsize=280&skin=http://www.example.com/skins/modieus.swf&repeat=none&stretching=fill&volume=90&file=http://www.example.com/xspf" width="600" height="300"></embed></object>
This assumes that you have first applied my patch from #450868: Fullscreen and Autostart do not work to get fullscreen support working in the firstplace!
Comment | File | Size | Author |
---|---|---|---|
flvmediaplayer-embed-params-vars.patch | 1.88 KB | mrfelton |
Comments
Comment #1
arthurf CreditAttribution: arthurf commentedI don't think this is correct. Please review:
http://code.google.com/p/swfobject/wiki/documentation
Comment #2
mrfelton CreditAttribution: mrfelton commentedFor SWFObject, sure... but we are generating embed code here - that is, code that someone is going to copy and paste into their own website. Are you saying that it is a requirement for them to use SWFObject to embed it?
Go to the JWPlayer setup wizard (http://www.longtailvideo.com/support/jw-player-setup-wizard), and look at the 'embed code' they generate (this is different from the swfobject code)
Comment #3
arthurf CreditAttribution: arthurf commentedLooking at youtube's code:
It looks like there are some specific elements that need to be rendered differently (movie always, allowFullScreen and allowscriptaccess if they are set).
My guess is that for browser compatibility (IE?) these are needed for the youtube player... Not sure about the JW player though. From what I understand, for validation to work, you need to wrap the embed object in the object tag
Comment #4
mrfelton CreditAttribution: mrfelton commentedI really haven't looked into this in too much detail, but what I do know for sure is that without allowfullscreen="true" set on the embed, fullscreen does not work with JW Player on FF/linux and IE/Windows XP. I possibly went overboard by just including all the attributes on the embed tag, but I just needed to get it working and that was simple to do and did the trick. As I understand it, the
tag is for some browsers, and the embed is for those that do not support , like IE.Comment #5
arthurf CreditAttribution: arthurf commentedIs the issue maybe the capitalization with allowFullScreen ?