EzDevInfo.com

vimeo

A full featured Ruby implementation of the Vimeo API Black Hole in the Midwest » Design, development and technology consulting » Matt Hooks black hole in the midwest is a design and development firm that builds web applications.

Parsing a Vimeo ID using Javascript?

Could anyone point me in the right direction to parse an ID from a Vimeo URL in Javascript?

The URL will be entered by a user so I will need to check that they have entered it in the correct format.

I need the ID so that I can use their simple API to retrieve video data.

Any help appreciated.


Source: (StackOverflow)

YouTube Vimeo Video ID from Embed Code or From URL with PHP Regular Expression RegEx

I want to get Video ID for YouTube or Vimeo via its Embed code or from URL, Any solution to do this with PHP ?


Source: (StackOverflow)

Advertisements

Get img thumbnails from Vimeo?

I want to get a thumbnail image for videos from Vimeo.

When getting images from Youtube I just do like this:

http://img.youtube.com/vi/HwP5NG-3e8I/2.jpg

Any idea how to do for Vimeo?

Here is same question, without any answer.


Source: (StackOverflow)

Lightbox to show videos from Youtube and Vimeo? [closed]

I'm looking for a lightbox to show videos from Youtube and Vimeo.

Any suggestions?


Source: (StackOverflow)

View Vimeo private video with an OAuth token

Can anyone give a help in Vimeo API using scribe? My goal is to access a private video (which I uploaded) without having to force the user to put password (this process should be done in background).

From what I understand / deduce from research is necessary:

  1. Request for application authorization using oAuth protocol and via the following link:

    https://vimeo.com/oauth/authorize?oauth_token=XXXX

    This operation is performed successfully and response data are sent to callback URL, something like:

    http://127.0.0.1:8001/XPTO.html?oauth_token=AUTH_TOKEN_EXAMPLE&oauth_verifier=VERIFIIER__EXAMPLE"

  2. According to Brad Dougherty (Vimeo API Staff) it´s possible do something like that

    If you go through the OAuth process as yourself, you can save that token and use that to make the calls.

I'm using this code:

service = new ServiceBuilder().provider(VimeoApi.class)
                .apiKey("API_KEY_EXAMPLE")
                .apiSecret("API_SECRET_EXAMPLE")
                .build();

OAuthRequest request = new OAuthRequest(Verb.GET,
        "http://vimeo.com/api/rest/v2?video_id=50305416");

request.addQuerystringParameter("format", "json");
request.addQuerystringParameter("method", "vimeo.videos.getInfo");

String oauth_verifier=VERIFIER__EXAMPLE;
Verifier verifier = new Verifier(oauth_verifier);

//I've tried differents combination to create this token
//I believe that my problem is HERE
//One unsuccessfully try: Token requestToken = service.getRequestToken();
Token requestToken = new Token(
        AUTH_TOKEN_EXAMPLE,
        API_SECRET_EXAMPLE);

Token token = service.getAccessToken(requestToken, verifier);

service.signRequest(token, request); 
Response response = request.send();

I've the following error:

Response body is incorrect. Can't extract token and secret from this: '401 Unauthorized - Invalid signature - The oauth_signature passed was not valid.'

What's escaping me? This is the correct way to do it, right?


Source: (StackOverflow)

Posting an embedded video link using the Facebook Graph API

When manually attaching a video link (from YouTube, Vimeo, etc) to a post using the Facebook web interface, Facebook automatically recognizes the link as a video, and allows the resulting status message to play the video inline. The video is displayed as an embedded player in the Wall or News feed.


Here's an example of what an embedded video looks like after posting manually.

Embedded Video


When posting a link using the Graph API, the video is not embedded.

curl -F 'access_token=...' \
     -F 'message=Link to YouTube' \
     -F 'link=http://www.youtube.com/watch?v=3aICB2mUu2k' \
     https://graph.facebook.com/me/feed

Not-Embedded Video


I suspect the answer is related to the source argument, but I'm not sure what the URL should be there. Specifying the same URL just leads to a post with no thumbnail image whatsoever.

source: A URL to a Flash movie or video file to be embedded within the post. read_stream.

How can the same embedded behavior be accomplished by using the Graph API alone?


Source: (StackOverflow)

How can I find download links for vimeo videos?

I saw that today vimeo changed the way they are streaming the videos and I can't stream their videos anymore. I saw that when I generate the link to the video, which was for example:

http://vimeo.com/moogaloop/play/clip:6649390/1eab2a25f30f1aadaf5e306d0f40fd6c/1292498602/?q=hd

It's redirecting me to a page saying "Permission denied". I tried using curl, but without any success. I sniffed the traffic and I saw that it's streaming from something like:

http://av.vimeo.com/02047/623/34209065.mp4?token=1292496582_34de09a6d13212cf26af08357d311c30

Does anybody know how to get the working URL to the video file?

The way I'm getting the videos at the moment is:

  1. Choose link http://vimeo.com/video_id.
  2. Get only the video_id.
  3. Get the XML for the video http://vimeo.com/moogaloop/load/clip:video_id;.
  4. parse the XML and find the necessary information:

    • request_signature
    • request_signature_expires
    • isHD
  5. Generate the link:

    $video_link = "http://vimeo.com/moogaloop/play/clip:".$video_id."/".$request_signature."/".$request_signature_expires."/?q=".$quality."";
    

If I do this manually through the browser it works, but if I do it through the script it doesn't.


Source: (StackOverflow)

Vimeo Froogaloop API not recognizing an event

I'm trying to recognize the onPlay, onPause, and onFinish event for vimeo using the froogaloop API. I've tried everything I could imagine with this thing, and no luck.

I get this error on Firefox: http://cl.ly/1I3I0d152O3M1H232528

And in Chrome: http://cl.ly/1A3z2q1g420g1x3r1x2F

Importing froogaloop from the CDN:

<script src="http://a.vimeocdn.com/js/froogaloop2.min.js"></script>

My JS:

$(function(){

    var vimeoPlayer = document.querySelector('iframe');

    $f(vimeoPlayer).addEvent('ready', ready);

    function ready(player_id) {

        froogaloop = $f(player_id);

        function setupEventListeners() {
            function onPlay() {
                froogaloop.addEvent('play',
                function(data) {
                    console.log('play event');
                });
            }

            function onPause() {

                froogaloop.addEvent('pause',
                function(data) {
                    console.log('pause event');
                });
            }

            function onFinish() {
                froogaloop.addEvent('finish',
                function(data) {
                    console.log('finish');
                });
            }
            onPlay();
            onPause();
            onFinish();
        }
        setupEventListeners();
    }

})

My HTML:

<iframe src="http://player.vimeo.com/video/3718294?api=1" width="623" height="350" frameborder="0" id="iframe-video"></iframe>

Source: (StackOverflow)

Force Vimeo HTML5 Video Embed

I'm trying to embed a Vimeo video and force it to use HTML5 by default.

Here's a thread about doing the same thing I'm tying to do but with YouTube.

Here's another thread talking about getting the Vimeo HTML5 cookie

Here's a discussion of the issue on Vimeo's site. Basically, I would be doing it in response to a user's preference on my site so their concerns don't really apply.

Does anyone know a workaround or way to force HTML5 Vimeo embeds even when Flash is available? (I know the cookie should work in Safari but I have many Chrome users.)

Thanks.


Source: (StackOverflow)

Get video id from Vimeo url

I'm trying to find the best regexp to fetch vimeo video id from URL.

Example urls :

https://vimeo.com/11111111
http://vimeo.com/11111111
https://www.vimeo.com/11111111
http://www.vimeo.com/11111111
https://vimeo.com/channels/11111111
http://vimeo.com/channels/11111111
https://vimeo.com/groups/name/videos/11111111
http://vimeo.com/groups/name/videos/11111111
https://vimeo.com/album/2222222/video/11111111
http://vimeo.com/album/2222222/video/11111111
https://vimeo.com/11111111?param=test
http://vimeo.com/11111111?param=test

My current regexp which doesn't work:

/http:\/\/(www\.)?vimeo.com\/(\d+)($|\/)/

Playground & Test here : http://jsbin.com/asuqic/1/edit?javascript,live


Source: (StackOverflow)

"Failed to execute 'postMessage'" error from Froogaloop via AngularJS directive

I wrote an AngularJS directive for vimeo videos with built in play/pause functionality using their froogaloop library.

It's works great! The only issue is that I get the following error when the page first loads.

Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('http://player.vimeo.com') does not match the recipient window's origin

Am I initializing the froogaloop object wrong in the directive? Any suggestions would be most appreciated.

You can check it out the plunker here: http://plnkr.co/edit/GKWNk3LhX0MR3lhpfqyA


Source: (StackOverflow)

Regex to extract domain and video id from youtube/vimeo url

I am copying a function that will take a youtube/vimeo url and return what site the video came from (vimeo/yt) as well as the video id.

Here's what I have so far: http://jsfiddle.net/csjwf/181/

<strong>Result:</strong>
<div id="result"></div>
function parseVideoURL(url) {

    url.match(/^http:\/\/(?:.*?)\.?(youtube|vimeo)\.com\/(watch\?[^#]*v=(\w+)|(\d+)).+$/);
    return {
        provider : RegExp.$1,
        id : RegExp.$1 == 'vimeo' ? RegExp.$2 : RegExp.$3
    }
}

var result = document.getElementById("result");
var video = parseVideoURL("http://www.youtube.com/watch?v=PQLnmdOthmA&feature=feedrec_grec_index");
result.innerHTML = "Provider: " + video.provider + "<br>ID: " + video.id;

var video = parseVideoURL("http://vimeo.com/22080133");

result.innerHTML += "<br>--<br>Provider: " + video.provider + "<br>ID: " + video.id;

Output:

Result:
Provider: youtube
ID: PQLnmdOthmA
--
Provider: vimeo
ID: 2208013

However, notice how for vimeo vids, if the url ends in the ID, the last number is always cut off. If you add a slash to the end of the vimeo url the id is pulled fully.


Source: (StackOverflow)

How to play youtube/vimeo video within the application in iPhone

I am building an application where I want to play video from url like Youtube, Vimeo, Direct url. I am making custom player using AVPlayer to play a video from a direct url of video clip(like www.abc/play.mp4). But later I faced a huge issue to play youtube & vimeo video. And after searching a lot I found these link where it says without using UIWebview I can't play a Youtube link:

Play YouTube videos with MPMoviePlayerController instead of UIWebView

Playing video from youtube link without UIWebView

So I just used this code:

NSString *youTubeVideoHTML = @"<html><head><style>body{margin:0;}</style></head> <body> <div id=\"player\"></div> <script> var tag = document.createElement('script'); tag.src = 'http://www.youtube.com/player_api'; var firstScriptTag = document.getElementsByTagName('script')[0]; firstScriptTag.parentNode.insertBefore(tag, firstScriptTag); var player; function onYouTubePlayerAPIReady() { player = new YT.Player('player', { width:\'100%%\', height:'200px', videoId:\'%@\', events: { 'onReady': onPlayerReady } }); } function onPlayerReady(event) { event.target.playVideo(); } </script> </body> </html>";

NSString *html = [NSString stringWithFormat:youTubeVideoHTML, videoId];
self.embedded_player_view.mediaPlaybackRequiresUserAction = NO;

[self.embedded_player_view loadHTMLString:html baseURL:[[NSBundle mainBundle] resourceURL]];

Now when I click on youtube/Vimeo video link from tableview its playing the video with the default player i.e. quicktime player. Its not running the video within the UIWebview frame itself. But I want to show the video in the 1st half of the screen i.e my UIWebview frame. Is that possible?

In my app I can see this:

when clicking on red play button I can see the video in full screen in quicktime player like this:

enter image description here enter image description here

But I want to show the video within the same webView frame not via quick time player. It should play like this:

enter image description here

Same does in MusicTube and PlayTube.

Or is there any other way to achieve the same? Any help will be appreciated. Thanks in advance.


Source: (StackOverflow)

Unsafe JavaScript attempt to access frame with URL

I've incorporated Vimeo into a WordPress theme I'm building, and I get these errors:

Unsafe JavaScript attempt to access frame with URL http://themes.ibrogram.com/beta/blog/ from frame with URL http://player.vimeo.com/video/4749536. Domains, protocols and ports must match.


Unsafe JavaScript attempt to access frame with URL http://themes.ibrogram.com/beta/blog/ from frame with URL http://player.vimeo.com/video/28496744?title=0&byline=0&portrait=0. Domains, protocols and ports must match.

It also (I think) is the reason for the page still loading: http://themes.ibrogram.com/beta/blog/


Source: (StackOverflow)

Vimeo - Embed not working in IE

I've developed a page for a client and something really weird is happening: http://cpdlectures.com/IStructE/Default.aspx

This Vimeo video works inside of Chrome, Mozilla etc. But it doesn't work in IE.

I initially thought it might be scripting error or something, so:

  1. I hit F12 to open my developer tools,
  2. Click Script,
  3. Refresh page to watch the JS code execution,
  4. Video works!

close Developer tools, video still works after refresh. Close the browser, reopen, broken again, refresh without opening developer tools, still broken.

What? Are Microsoft implementing the Observer effect into their browsers now?

How can this be?


Source: (StackOverflow)