-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
play() not working after setSrc() in Firefox #246
Comments
I've had very similar issues recently. In my case I'm creating a mutli-track audio player which, most obviously, needs to be able to easily switch between audio files. The problem as I see it is not with play() but with setSrc(). Are you able to get setSrc to work in IE 7-8 as well? For me setSrc is only failing on the browsers using the flash fallback (and since i'm using mp3 that includes FF). I suspect it's a MediaElement problem, but I have thus been unable to figure a way to fix it. My project needs to ship asap and as a matter of last resort I'm going to try completely redrawing the dom node and re-instantiating ME on track change for those browsers that are using the fallback. I'd be very interested to know if setSrc is actually working for you in IE. I'm using the most current version of mejs (2.1.9) |
Update: Redrawing the dom node seems to have worked for the most part, though it's still slightly buggy. Here's a simplified version of things: hope this might help |
I'll try to work on this for an upcoming release. I'm focusing on building in some iPad features and some things needed for a client, but I should be able to get back to general bug fixes in a week or so. Thanks for the feedback! |
I am having the same problem with firefox. mp4 video playing and switching great with html5 video in chrome safari and ie9 - but firefox doesnt switch. |
Are you guys calling the
|
yes i was. I got around the issue by rebuilding the DOM and reloading the player like the above link showed: http://jsbin.com/odilex/edit#javascript,html not optimal, but it works.. |
Yessir. mediaElement.setSrc(originalVideo);
mediaElement.load();
mediaElement.play(); |
John, Thanks for looking into this. I haven't opened up my Windows VM, but I can tell you that .setSrc throws an error on FF 6.0.2. Error msg: "this.media.setSrc is not a function", mediaelement-and-player.js v2.1.9 on line 1474. (and yes, I was calling .load(), but that obviously did little when .setSrc was failing) |
Might i suggest browser stack to test on different browsers for windows: |
Could one of you guys provide a complete example of this failing? In my tests, I can call setSrc and load just fine, but I'd really like to fix this for you. |
In my example posted above, I'm specifically trying to setSrc within the |
Here's the stripped out player from my client's site that uses just the setSrc method (i.e. no redrawing of the dom). http://jacobfierro.com/mediaelement/ I'm calling setSrc in http://jacobfierro.com/mediaelement/js/views.js way at the bottom. Please let me know if you need any help. |
It seems something is causing the DOM to redraw the SWF in firefox when you run these calls and the flash player does not update it's src URL. If you turn on pluginDebugging, you can see the setSrc, load, and play calls being received by the SWF in other browsers (IE 8 for example) but mac firefox just does a SWF refresh and reloads the original src file. In fact, just calling "player.pause()" and then "player.setSrc(" appears to wipe out the existing SWF and replace it. |
Well - I spoke too soon. I was moving around a parent div with jquery, and mac firefox will "refresh" an embedded SWF if you mess with it in the DOM at all. After removing my animations, the setSrc is working correctly. I've run into this before years ago doing custom flash video player development, and it's been so long - I completely forgot about this use case :-) John - a safety net may be to change the URL in the flashvars parameter in the DOM when a setSrc call is run... Of course this is quite an edge case in my instance. |
Matthew, |
Here's some code that work well for me in Flash mode (tested Firefox 8 on Mac, and IE8 on PC)
|
In my case "flashmediaelement.swf" was missing. |
I got the same error (in FF and Chrome). I left out the |
hey I have the same problem here what is super confusing to me is that I use the same code here |
Thanks for MediaElement.js, it's wonderful.
A client of mine asked me to investigate adding a preroll to our MediaElement.js player. I hacked for a few hours and got something that works well in all browsers but Firefox (both FF6 and FF3.6).
http://jsbin.com/umutux
The video loads -> the src is changed to the preroll -> on an
ended
event, it changes the source to the original video and triggers a play() event. I've searched and found other MediaElement + Firefox issues and tried my own custom ended event, but to no avail.Is this a problem with Firefox or with MediaElement.js?
The text was updated successfully, but these errors were encountered: