Getting Vimeo To Play Inside JWPLAYER

This thread may refer to an older version of JW Player! Check our articles for the most up-to-date information.
This Q&A thread was imported from our previous system and could apply to an older product.
  • Can you post on how to do this.. maybe lefty can help here like on the Dailymotion..

    i am trying to learn and figure this out.. yeah you can webscrape the link from the http://www.keepvid.com or even with clipnabber.. but the link will download but does not play directly in jwplayer..

    like with google someone posted the example page that needs to be loaded.. Can someone explain exactly what this page does??

    bc.. <?php

    // Google URI: http://video.google.com/videoplay?docid=7206494026138253535
    // MP4:
    // call with: http://www.mydomain.com/path/Google_URI.php?docid=7206494026138253535
    // JWMP code:
    // 'file': encodeURIComponent('Google_URI.php?docid=7206494026138253535'),
    // 'type': 'video',
    // FLV:
    // call with: http://www.mydomain.com/path/Google_URI.php?docid=7206494026138253535&type=flv
    // JWMP code:
    // 'file': encodeURIComponent('Google_URI.php?docid=7206494026138253535&type=flv'),
    // 'type': 'video',

    $docid = (isset($_GET['docid'])) ? strval($_GET['docid']) : '7206494026138253535';
    $type = (isset($_GET['type'])) ? strval($_GET['type']) : 'flv';

    $file = @file_get_contents("http://video.google.com/videoplay?docid=$docid");

    if($type == 'flv')
    {
    preg_match("/googleplayer.swf\?videoUrl\\\\x3d(.*?)\\\\x26/", $file, $match);
    }
    else
    {
    preg_match('/right-click <a href="(.*?)">this link/', $file, $match);
    }

    $uri = urldecode($match[1]);

    header("Location: $uri");

    ?>


    so if i scrape with the link from keepvid.com then would i use something similar like above to get the the .flv to play in the jwplayer??

    see is you paste this in your browser it returns you the Download Link which works if you click on it downloads the .flv

    http://keepvid.com/?url=http://vimeo.com/2168002

    but if you paste the same link in the JWPLAYER..

    just need an explanation why it does not work and what needs to be done to circumvent it.. from what i found i think it needs to do something similar to the google_uri.php page above...

    lefty any help here. or anyone with knowledge..or point me in the direction where i can read any info on net to figure this out..

    thanks
    rick


  • First of all, it's just magic.

    The Google Video script is scraping for the URI of the video file right here:bc.. if($type == 'flv')
    {
    preg_match("/googleplayer.swf\?videoUrl\\\\x3d(.*?)\\\\x26/", $file, $match);
    }
    else
    {
    preg_match('/right-click <a href="(.*?)">this link/', $file, $match);
    }


    That's it, that's all it does.

    The KEEPVID URI that you posted above ( *http://keepvid.com/?url=http://vimeo.com/2168002* ) returns a page that you can scrape just like you scraped Dailymotion.

    The URI looks like this:bc.. http://www.vimeo.com/moogaloop/play/clip:2168002/940cd7f9644084565e9f7b2be8fc5abf/1236744000/video.flv?q=
    so use the *type=video* flashvar to tell the player it is a video.

    Up Down 0 rated
  • hello lefTy

    hmm your are right BUT

    the link is not on this page :-/
    can not find any link like this
    clip:2168002/940cd7f9644084565e9f7b2be8fc5abf/1236744000/

    any idea how i can geht this values ?

    best regards

    Up Down 0 rated
  • I wrote a plugin to play vimeo videos in the jw player.
    example here: http://wessite.dreamhosters.com/vimeo/

    It's also perfectly legit with the terms of Vimeo because the video is loaded through the moogaloop player.

    If you are interested, contact me: info [at] wessite [dot] com

    Cheers

    Up Down 0 rated
  • preaty nice wessite. the two video you have on that exampla plage are they just embed using your plugin or can they be added to a playlist mixed with like youtube videos as well? Oh and the last video its and HD right?

    Up Down 0 rated
  • hey water, yep the videos are embedded in the jw player, for now it's not possible to add them in a playlist but I think it can be done.

    both are in normal quality, of what I read on the Vimeo forums, only the videos of people with a plus account can be embedded in HD. you can of course try to retrieve the HD flv file directly but that would be against the terms of Vimeo...

    greets

    Up Down 0 rated
  • Looks very good could this also be incorporated into justin.tv files?

    Up Down 0 rated
  • I don't think so, justin.tv doesn't have an API

    Up Down 0 rated
  • the plugin is updated and now supports playlists,
    http://wessite.dreamhosters.com/vimeoplaylist/

    also an loading indicator is added and several bug fixes.

    cheers

    Up Down 0 rated
  • It really isn't very hard to figure out the url to the source video (usually MP4) of vimeo videos - I worked on this last night, as part of a client website video page:
    http://www.davekiss.com/?page=video

    The videos are automatically loaded from his vimeo account, http://vimeo.com/davekiss/

    I used the RSS feed feature of vimeo to get the video IDs of his videos (and other info such as title).
    I then wrote a small function to convert a vimeo ID into a source video (mp4) URL:

    bc.. function vimeoid2url($id) {
    $xmlurl = "http://www.vimeo.com/moogaloop/load/clip:{$id}";
    $videoxml = file_get_contents($xmlurl);

    preg_match('|<request_signature>(.*)</request_signature>|i',$videoxml,$sig);
    preg_match('|<request_signature_expires>(.*)</request_signature_expires>|i',$videoxml,$sigexp);

    $url = "http://www.vimeo.com/moogaloop/play/clip:{$id}/{$sig[1]}/{$sigexp[1]}/?q=sd";
    return $url;
    }


    Then I simply load that URL in the JW FLV player like any other video URL.
    (although you do need the "type=video" FlashVar so the player knows it is a video)

    If you understand the above code, great, I hope it helps you. If not, and you would like help with getting something similar working for yourself, I can be contacted at
    http://www.andrewbeveridge.co.uk
    or
    jwflvplayer.forums@andrewbeveridge.co.uk

    Good luck =)

    Up Down 0 rated
  • Works quite well!

    Thanks

    Up Down 0 rated
  • andrew - im not a php developer but am trying to learn quick so i can get your function to work

    wessite - i would love trhe plugin but how do i get it ?

    Up Down 0 rated
  • thanks for the example.. as i need to do with many different servers

    Up Down 0 rated
  • checked out as are you using Just Firebug to get the GET request... and then Trial and Error to your get the correct equation.

    i understand your example as i just typed in the to variables. so did one of my videos then i get the xml

    http://www.vimeo.com/moogaloop/load/clip:3279919

    I just manually took the the two variables

    <request_signature>7f58cd594a8bd0479f022d6b5298294a</request_signature>
    <request_signature_expires>1248381000</request_signature_expires>

    and manually entered them into the address bar

    http://vimeo.com/moogaloop/play/clip:3279919/7f58cd594a8bd0479f022d6b5298294a/1248381000

    and it worked.. as i looked at their API as some providers provided the direct link

    other do not provide as i do not see in their API on Vimeo but you gave me the docs. :)

    Up Down 0 rated
  • @frustrated: If you like, I can help you get started, or write a PHP page to do the trick for you. Feel free to email me, or whatever.
    You can email wessite at info[at]wessite[dot]com for the JW plugin, but he is charging for it, not sure how much.

    @lost: glad I could help =)

    @Subfighter: I hope it is all working great for you now, if so, glad I could help =)

    Up Down 0 rated
  • I made have been using a script to auto extract the url from the way Subfighter suggests and most of the time it works. But there is a serious fault with it that means sometimes my videos just won't load :P

    It is probably happening to all of you you just haven't been around the times it doesn't work.

    I think i found something about it here (it's a bit old though)...

    http://www.vimeo.com/forums/topic:3663

    Up Down 0 rated
  • I have upgraded the Vimeo Plugin to work with the newest Moogaloop API of Vimeo.

    Check it out here: http://wessite.com/labs/vimeoplugin

    Up Down 0 rated
  • I want to embed the player on my website in such a way that it can play videos from other sites , it uses the link of website like megavideo.com or youku.com or 56.com etc.. and play it on my site . how can i do that can anyone help me please.... I will be very thankful ....

    Up Down 0 rated
  • @Everyone who has this issue in java/jsp

    I used the code from "Andrew Beveridge" and translated for my needs (for that: Thanks @ Andrew)
    In java I used saxbuilder to browse the xml. Underneath the (for me working) result...
    bc.. private boolean elementNotNullOrEmpty(Element el) {
    return el != null && el.getText() != null && el.getText().trim().length() > 0;
    }

    public String VimeoId2Url(String id) {
    String url = null;
    try{
    URL xmlurl = new URL("http://www.vimeo.com/moogaloop/load/clip:"+id);
    InputStream is = xmlurl.openStream();

    SAXBuilder builder = new SAXBuilder();
    builder.setFactory(new DefaultJDOMFactory());
    Element root = builder.build(is).getRootElement();

    String sig = null;
    Element sigEl = root.getChild("request_signature");
    if (elementNotNullOrEmpty(sigEl)) {
    sig = sigEl.getText();
    }

    String sigExp = null;
    Element sigExpEl = root.getChild("request_signature_expires");
    if (elementNotNullOrEmpty(sigExpEl)) {
    sigExp = sigExpEl.getText();
    }

    url = "http://www.vimeo.com/moogaloop/play/clip:"+id+"/"+sig+"/"+sigExp+"/?q=sd";
    }catch(Exception e){}
    return url;
    }

    Up Down 0 rated
  • Can anyone tell/explain if I can use the wessite vimeo plugin without swfobject.js

    Currently, I have something like this:
    bc.. <object width="400" height="320">
    <param name="FlashVars" value="video=http://vimeo.com/4050424&type=image&plugins=../include/vimeo.swf" />
    <param name="allowfullscreen" value="true" />
    <param name="allowscriptaccess" value="always" />
    <param name="movie" value="../include/player.swf" />
    <embed src="..include/player.swf" FlashVars="video=http://vimeo.com/4050424&type=image&plugins=../include/vimeo.swf" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="400" height="320"></embed>
    </object>


    Up Down 0 rated
  • It should work with any method of embedding.

     
    Up Down 0 rated
  • Hey Wessite,

    very nice example! Could you tell me how you hid the controls of the vimeo player?
    I'd like to do the same thing with my player: http://www.nonverbla.de/nonverblaster-hover

    cheers
    Rasso

    Up Down 0 rated
  • is nor working more for me :(

    Up Down 0 rated
  • @igor – do you have a link?

     
    Up Down 0 rated
  • I need vimeo plugin to download the flv file without need to play it just click the link and download begin is that possible ?

    Up Down 0 rated
  • @Nasom – Check out – http://wessite.com/labs/vimeocomponent

     
    Up Down 0 rated
  • i need to play following video
    http://vimeo.com/user11751780/review/42313786/f87d452c05
    using jw player in in php drupal website plz provide me the code to doing this.


    Regards
    siddhartha saini

    Up Down 0 rated
  • We don’t support Vimeo officially, check out the link above.

     
    Up Down 0 rated

This QA is closed.

Still don't have JW Player? Get It Here