silversurfer5150 — 2011-09-11T11:41:35-04:00 — #1
I am current writing an application which alows users to switch between using Youtube player and flowplayer to play different videos. My problem is quite simple but perplexing. I cannot call:
ytplayer.pauseVideo(); //yt api call
$f("splash").pause(); //flowplayer api call
using the same button. this goes for all the other commands, not just pause.
I am using chromeless players and making my own buttons which is why I want to do this.
There is no error on my setup of the scripts as I have complete control over both api's so long as I do not mix them.
This tells me there are conflicts between the two namespaces. Does anyone have any suggestions for getting round this as ideally I would like a hyperlink which calls a function as below:
I know that I could just use JQuery to show/hide different sets of buttons depending on which player is available but that would be overkill.
aussiejohn — 2011-09-13T07:43:10-04:00 — #2
I don't really see anything wrong with abstracting out the methods like you have done in your example there.
Does the flowplayer play YT videos as well? If it does you might be able to just "ingest" YT vids in to that player.
If not, there is always JWPlayer
silversurfer5150 — 2011-09-13T08:53:05-04:00 — #3
Hi thanks for your reply John, no I can't understand it either and but I still suspect some sort of namespacing conflict.
Flowplayer does play youtube videos but I really wanted to use both players in this plugin. This is mainly because when you have a yt object on the page you can use a developer key which allows you write/upload access to your youtube acount.
Thanks for your input anyway, I must check out JW player next time I have a big video project because I know Flowplayer very well and would like to try something else.