SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: Api conflict

  1. #1
    SitePoint Evangelist silversurfer5150's Avatar
    Join Date
    Aug 2010
    Posts
    534
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Api conflict

    Hi there,

    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

    and

    $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:

    Code:
    function pause()
    {
    if(ytplayer)
    {
      ytplayer.pauseVideo();
    }
    else
    {
       $f("splash").pause();
    }
    }
    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.

    any ideas?
    "Persistence is the path to perfection"

  2. #2
    Under Construction silver trophybronze trophy AussieJohn's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    776
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    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
    var details = {
    . . web: "afterlight.com.au",
    . . photos: "jvdl.id.au",
    . . psa: "usethelatestversion.com"
    }

  3. #3
    SitePoint Evangelist silversurfer5150's Avatar
    Join Date
    Aug 2010
    Posts
    534
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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.

    thanks again
    "Persistence is the path to perfection"


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •