Has anyone used SWFObject 2.0 ...Has anyone used SWFObject 2.0 (http://code.google.com/p/swfobject/) with the JW Media Player? I tried using it. I get no errors in IE but the player is not rendered.
May be it's because this is only a RC3 release? On the download link : "SWFObject 2.0 rc3 (NOTE: this is a pre-release which may contain bugs and other defects, and may be unstable)"
I got it working finally (not sure what the problem was). There's a demo here (view source to see the code):
http://www.trljc.com/tony/movies/two/
The funny colors are so we can see what's going on.
The playlist looks (something) like bc.. <track> <creator>Testing</creator> <location>belmondo.flv</location> <image>belmondo.jpg</image> <title>Belmondo (silent)</title> </track>
(Note: this is *not* a tutorial on relative addressing.)
You should also look at this info: <http://code.google.com/p/swfobject/wiki/SWFObject_2_0_documentation>
PS: I tested it in Windows XP Pro SP2, and the full-screen mode is broken in IE, but works in Opera and Firefox. I use a Mac myself, works everywhere (we don't have IE).
I tried this also, replaced the swfobject.js file version 1.5 with swfobject.js version 2.0, uploaded it to my site, both the mediaplayer.swf and imagerotator.swf would not render. Replaced 2.0 with 1.5 and everything worked again. I'm going to try it with the *SWFObject 2.0 HTML and JavaScript generator v1.1* found on this page:
You got it! I changed all to full URL's and its working perfect!
A couple of additonal questions...
With the script for swfobject.js 1.5, the flashvars were added using bc.. so.addVariable('example-file','imglist.xml');
With swfobject.js 2.0 they are added using bc.. flashvars.example-file = 'imglist.xml';
This is the correct code for v2.0 I assume, or would it also work if you used the old coding?
Also, should we be upgrading to swfobject 2.0 now or is it really necessary? I don't understand the reasoning for the upgrade, its too technical for me.
And finally, what should the lowest flash version installed setting be? I see you have 7.0.0...
Rather than give you a poor explanation, I'm going to refer you to their documentation page for a good explanation. [url=http://code.google.com/p/swfobject/wiki/SWFObject_2_0_documentation]*SWFObject_2_0_documentation*[/url]
You can use JavaScript dot notation, object notation or square bracket notation to add the flashvars to the objects. Google for all three for a better explanation. All work, so it becomes a matter of personal preference.
I would start migrating to v2 because it is more standards compliant and will continue to be updated and maintained.
For the lowest Flash version. If you are using h.264 or wmode and fullscreen (and a few other enhancements), you have to require 9.0.115. Earlier v9.x.x versions are buggy and don't have the full set of features. If you are only doing images, v8 is sufficient. For old OSs that can't update to v8, v7 will display jpg images, FLV without fullscreen, and MP3s. You do lose the JavaScript API also.
One thing to be aware of when using swfobject v2.0, is that it replaces the *whole* HTML element when it writes the player code. swfobject v1.5 only replaced the *contents* of the HTML element.
So you need to move the player id and class to the anchor element and give the div element a new id and class, especially if you are using CSS to position the player.
bc.. <div id="playercontainer" class="playercontainer"> <a id="player" class="player" href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash">Get the Flash Plugin to see this Flash Player.</a> </div>
One more gotcha. You have to specify the full, three groups of digits for the version. Won't work:bc.. swfobject.embedSWF('mediaplayer-3.16.swf', 'player', '540', '669', *'9'*, false, flashvars, params, attributes); Will work:bc.. swfobject.embedSWF('mediaplayer-3.16.swf', 'player', '540', '669', *'9.0.115'*, false, flashvars, params, attributes);
@Jeroen: Apparently 2.0 is in release, and the website says that the 1.5 instructions are "obsolete." It seems to work extremely well. I haven't tried it with *your* API yet.
@monty: You seem to be able to set styles from the SWFObject 2.0 API, something like: bc.. if (swfobject.hasFlashPlayerVersion("6.0.0")) { swfobject.createCSS("body", "margin:0; padding:0; text-align:center"); swfobject.createCSS("#putHere", "margin: 5%"); } I have a test page here: http://www.trljc.com/tony/movies/two/
Initially, I had used a "span" container for my player; nice inline element for that purpose, enclosed in a div that I could style any way I wanted. But the API works too.
Thanks for the info. I'll have to try that CSS stuff. I haven't had the time to work my way through the complete swfobject documentation yet, still converting some very complex applications and working through the gotchas.
Here's a real gotcha! If you are rewriting the player code to change settings, it won't work with swfobject v2.0.
Here's why:
swfobject v2.0 replaces the *whole* HTML element with the player code. So... when you go to write the player again, there is no element to overwrite.
So... before you write/rewrite the player, just write the content of the containing element. Might as well do it in the common createPlayer() function:bc.. function createPlayer() { pL = document.getElementById('playercontainer'); pL.innerHTML = '<div id="player"></div>'; This is assuming that the containing element has an id of "playercontainer" and that you are writing the player to an element with an id of "player".
Thanks for the speedy reply. I had already tried the dot notation without success, but I couldn't get any of your supplied methods to work either. Perhaps I'm not implementing it properly? I've posted my test file with the dot notation redirect. It should forward to Google in the absence of Player v10, but instead displays my static content. Any guidance is much appreciated!
It kinda, sorta seems like you have to do it like this:bc.. swfobject.embedSWF("testanim.swf", "testanim", "400", "400", "10.0.0", false, flashvars, params, attributes); if (!swfobject.hasFlashPlayerVersion("10.0.0")) { window.location = 'http://www.google.com'; }
I've updated to swfobject 2 because it's already used elsewhere on the site. It works, but my Javascript controls that used to work with swfobject 1.5 don't work anymore. bc.. // functions for the flv player VideoGallery.prototype.thisMovie = function(movieName) { if(navigator.appName.indexOf("Microsoft") != -1) { return window[movieName]; } else { return document[movieName]; } };
Without seeing your code, I'm reduced to making wild guesses.
Here's the first one: In your swfobject attributes, did you set both *id* and *name* to the name of the player, same as the *javascriptid*, _NOT_ the same as the id of the HTML element that the player code is overwritten to? bc.. var attributes = { id: 'mpl', name: 'mpl' };
"kinda, sorta seems like" really means that I didn't test it with 2.0 before posting. When it didn't work and was conspicious by its absence on the swfobject 2.0 google code site, I realized that maybe there no longer was a redirectUrl. And their example of the conditional was the only hint about what to use instead.
Thanks for your reply. The id & name are OK. Maybe you have an example of sending events to the player with Javascript like next, previous, play, playitem(playlistitem)?
I have the Player working great with SWFObject2.0 but my only problem now is that I can't get the displayheight param working .
I used this with SWFObject1.5 to get the media player to appear/disappear on rollover... but this doesn't seem to work with SWFObject2.0 - anyone got any ideas on how to get the player to appear/disappear now?
I have the same issue as Cola with regards to losing playlist appear / disappear mouseover functionality when changing from swfoject 1.5 to 2.
Demo using swfoject 1.5 - the playlist appears / disappears on mouseover of the player: http://www.theinstamatics.com/test-jw-03.htm
Demo using swfoject 2 - the player works but the playlist does not appear / disappear on mouseover of the player: http://www.theinstamatics.com/test-jw-03a.htm
Demo using swfoject 2 - with Ajax's suggested mod re createPlayer in this discussion - the player works but the playlist does not appear / disappear on mouseover of the player: http://www.theinstamatics.com/test-jw-03b.htm
Any ideas on getting the playlist appear / disappear functionality working with swfobject 2?
It's *VERY* important to note that one of the major differences between SWFObject v1.5 and swfobject v2.0 is that swfobject v2.0 *REPLACES* the entire HTML element rather than just it's contents, as SWFObject v1.5 did. See my post of 12.04.2008 above.
Therefore, your entire div with the mouse events gets wiped out.bc.. <div id="wrapper"> <strike><div id="placeholder" onMouseOver="showlist(150)" onMouseOut="showlist(19)"> <a href="http://www.macromedia.com/go/getflashplayer">Get the Flash plugin</a> and enable Javascript to see the player. </div></strike> </div> So, you have to move the mouse events to the <div id=wrapper> which is the container for the player because all of this code ceases to exist once swfobject v2.0 overwrites with the object/embed code for the player:bc.. <div id="placeholder" onMouseOver="showlist(150)" onMouseOut="showlist(19)"> <a href="http://www.macromedia.com/go/getflashplayer">Get the Flash plugin</a> and enable Javascript to see the player. </div>
An alternative is to move the id="placeholder" to the anchor element and include all of the text within the anchor element tags. If you do that, you no longer need the outer most wrapper div:bc.. <div id="wrapper" onMouseOver="showlist(150)" onMouseOut="showlist(19)"> <a id="placeholder" href="http://www.macromedia.com/go/getflashplayer">Get the Flash plugin and enable Javascript to see the player.</a> </div> With this code, swfobject v2.0 will only overwrite the anchor element with the object/embed code. That's why you need to move all of the text inside the anchor element tags.
What is the difference using static or dynamic publishing method? I see everyone here is using dynamic (swfobject.embedSWF), both work with the media player?
Dynamic publishng allows you to use JavaScript variables, conditionals, as well as the full range of JavaScript functions, methods, etc., to define your player at the moment it is published.
If you use dynamic publishing, you can also re-publish the player with changed flashvars, parameters, and attributes.
For instance, you could generate a unique userid with a JavaScript random number and append that userid to a file request or the callback (for statistics).
If you're using swfobject v2.0 with Opera 9, you may find that this code:bc.. return document[movieName]; no longer returns the movie reference object.
Since this code seems to work in IE6, FF2, and Opera9, I'm using it with swfobject v2.0:bc.. function thisMovie(movieName) { return document.getElementsByName(movieName)[0]; }; Maybe someone with IE7 could test it.
Hi all, I'm pretty new to this player and I think its excellent, so firstly well done and many thanks for making it free to use for everyone's open support here in this forum.
I'm just adding video to a new website having previously used Flash Video to import and create the players. I've just discovered this topic after noticing that the SWFobject supplied with the current JW FLV MEDIA PLAYER 3.16 is using v1.5 and that v2.0 has now been released as of March 14th over at:
Am I correct in thinking media Player v3.16 doesn't currently support v2.0 of the object and that support will be coming? Also, is it recommended to wait for v2.0 support or go with what is available now with v1.5?
Will the example tutorials or set-up wizard be updated accordingly, or will they still work okay, given there seems to be lots of issues reported on this forum topic?
Lastly, the player code generated by the setup wizard contains the source in the first line as: http://www.jeroenwijering.com/embed/swfobject.js Should this be changed to http://www.mywebsite.com/embed/swfobject.js and does it matter if its stored in a different folder/path?
Oops, just noticed "OK - good to know. Willchange to SWFObject 2 with the 4.0 player (and update the tutorial)." from earlier this month. That answers some of my questions!
The JW FLV Media Player and the Image Rotator work fine when using swfobject v2.0 to generate the player's object/embed code.
There are a few small differences between the implementation of SWFObject v1.5 and swfobject v2.0 that are noted in this thread.
You should host swfobject.js and mediaplayer.swf on your own server, especially if you want to use playlists and other data files ( in fact, it's mandatory because of Adobe Flash Player security restrictions ).
You can store the files wherever you want as long as the location is web-accessible. If you can't figure out the absolute or relative paths, you can always use a full URI ( the recommended way for beginners ) to request any file from your server.
Can someone tell me if they've been able to get fullscreen to work? This doesn't seem to work: bc.. var params = {quality: "best",menu: "false", allowfullscreen: "true"};
(note that wmode is not defined so that isn't the issue)
i use swfobject 2.0 with dynamic method it works perfectly in FF but not in IE 6. Sometimes the flash appear and sometimes not. I need to refresh 3 or 5 times to make it appear.
@JOKERz - you need to set the flashvars width and height
from the "Supported Flashvars" page - http://www.jeroenwijering.com/?item=Supported_Flashvars bc.. height (320): Sets the overall height of the player/rotator. width (260): Sets the overall width of the player/rotator.
the error means that there is a problem with the names/id of something
you need to go about it in a systematic way to narrow down the cause -
start with a blank page and no script and only one player - test - if no error then add stuff - test - etc.
I have a simple stand alone sample of swfObject 2.0 and mediaplayer.swf 4 working correctly, but when I try to incorporate it into a 'real' page, with more flashvars set, it doesn't seem to work. The player renders in FF with the start up image, but then can't find the video to play so it just chugs. In IE (6 and 7), it only displays the alternative text.
Here is the HTML:
bc.. <div id="right_content" class="movie"> <div id="player_container">what the hell?</div> </div>
All of the necessary files are confirmed to be in the correct locations, and the relative paths inside the script block are correct, as well.
I have read a lot about these 2 tools working together (mediaplayer and swfObject), but can't seem to see why this isn't working. Any help is much appreciated!
@Greenberg - from - http://www.jeroenwijering.com/?item=Supported_Playlists bc.. *Common pitfalls* I'd like to point out two common pitfalls users encounter when using playlists. First, always try to use full URL's (including the http:// part) when referring to files, links or images in your playlists. It will save you a lot of troubles with unresponsive SWF's or "file not found" errors! Nine out of ten times this is because the relative-url setup isn't working. Note that the Flash plugin checks for image and MP3 files relative
also make sure the flash plugin is up to date in each browser: adobe flash version test: http://www.adobe.com/go/tn_15507 adobe flash deinstall: http://www.adobe.com/go/tn_14157 adobe flash install: http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash
I upgraded swfobject 1.5 to 2.0 and it works fine in both FF and IE7 with an up-todate Flash player. But expressinstall.swf doesn't work. I am playing H.264 files, so I need Flash player version 9.0.98 or newer. On a computer with Flash player 9.0.16 I get this message in Firefox: "Express Install is not supported by this version of Flash". IE6 displays the text I have written in the Flash container. No expressinstall happening in either browser.
The 1.5 version is at www.ullerup.com/tenerife2008.html and the 2.0 version at /tenerife2008v2.html.
Has anybody managed to get expressinstall to work?
I was turning jap.. I mean, crazy with getting the Javascript interaction to work with SWFObject 2.1 with static publishing.
The trick is to use
bc.. swfobject.getObjectById(id)
to get the reference to the movie object. I'm embedding many movies in a Coda Slider, so the thing was tricky (using jQuery too). I tried to get the object reference with jQuery but I couldn't do it. So, long story short:
The above code is working fine in Both IE and firefox . But the issue is... When I run the above code in IE.The IE give status bar message "Error On Page" because of "MyId" is undefined
My code is working correct but i just want to get rid of the unwanted msg on status bar. plz help me
flvplayer is still "delivered" with swfobject 1.5 - is there a reason for that or will 2.0 be the defaukt version within short? Was wondering because the implementation changes are quite different and there seem to still be issues with 2.0
I would like that the code I write today is still useable when the next version comes. Any advice?
bc.. "and there seem to still be issues with 2.0 " IMHO, everyone should be using swfobject v2.2 by now. Or at least load swfobject v2.1 from Google:bc.. <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/swfobject/2.1/swfobject.js"></script>
bc.. "It still "ships" with 1.5, so I assume there is a reason?" I've never seen any issues with swfobject v2.2 on hundreds of implementations up through the v4.4.139 player.
I also monitor the mailing list at the swfobject Google Code site. There haven't been any issues so far, with swfobject v2.x and JW players.
swfobject v2.x has quite a few improvements and enhancements and IMHO is much easier to use.
But SWFObject v1.5 works, so it's OK to use.
From the jist of Jeroen's last post on the subject, I surmise that he is planning to upgrade, it's just that there will be a lot of pages and the Wizard to update.
ok, thanks lefTy. I am scratching my head trying to get pre-rolls to work, need to put short ads and/or trailers in front of the video. Thought it might have something to do with swfobject 2. I also have problems getting DRelated to work properly. Seems to work with normal files, but not when I use streamer/file setup. Seems playlists for streaming video is not very well documented: Maybe it is not very common?
Also, you should not use wmode=transparent unless you are absolutely sure that you need it, because it is buggy. (The JW FLV Player doesn't have a transparent mode, so you don't need wmode=transparent.) If you want to display HTML elements over the player, use wmode=opaque.
Also, be aware that swfobject v2 *_COMPLETELY REPLACES_* the HTML element that it writes the object element to, unlike SWFObject v1 which only replaced the contents of the HTML element.
I need help uploading my site every time I upload it, I open the html file and it just shows a flash download link. And on my desktop my index.html opens just fine and displays site just fine. I can upload some code if anyone can help.
The problem is that urlObtenerFeed only load visualizadorcontenidos/AgregadorFeedsCU/FormularioAgregadorFeedsObtenerFeed.do?idFeed=${form.idRssGaleria}
Can someone please tell me the notation for populating plugin attributes using an object oriented approach? Also, is there any kind of list of what is a flashvars, what is a params, and what is an attributes?
I tried:
var plugin_flow = new Object(); plugin_flow.position="bottom"; plugin_flow.showtext="true"; plugin_flow.coverheight="200"; plugin_flow.size="400"; plugin_flow.controlbaricon="true"; plugin_flow.onidle="show"; plugin_flow.onpaused="show"; plugin_flow.onplaying="hide"; plugin_flow.oncompleted="show"; plugin_flow.font="Trebuchet MS"; plugin_flow.fontsize="24"; plugin_flow.titleoffset="25";
var flashvars = new Object(); flashvars.controlbar="top"; flashvars.file="_jwplayer.xml"; flashvars.width="600"; flashvars.backcolor="000000"; flashvars.frontcolor="FFFFFF"; flashvars.stretching="uniform"; flashvars.autostart="false"; flashvars.playerready; "playerReadyCallback"; flashvars.plugins="flow-1"; flashvars.flow=plugin_flow;
var params = new Object(); params.allowscriptaccess="always"; params.allowfullscreen="true"; params.wmode="transparent"; params.flow=plugin_flow;
but neither way (via flashvars, nor params) populated the flow.____ attributes correctly.
</html> runs for me with a few minor changes to use my files. If you are going to use a full URI for the playlist, you *MUST* use a full URI for the player, so you don't run afoul of the Adobe Flash Player *[i]EXACT SAME DOMAIN[/i]* security restrictions. The Adobe Flash Player may actually be seeing the domain of your swf as something other than www.localdogrescue.com depending on your virtual hosting, etc.