Vimeo videos in iPhone app

2019-03-09 19:20发布

I was wondering if there's a way to "embed" a Vimeo video in an iPhone app.

For YouTube videos I'm using a webview containing the correct embed code for the YouTube video and the iPhone's native YouTube support will then transform the flash player into a YouTube button.

Is there a similar way to play Vimeo videos from my app?

Maybe someone knows the correct <video>-src for Vimeo videos?

thanks, Thomas

标签: iphone vimeo
6条回答
ゆ 、 Hurt°
2楼-- · 2019-03-09 19:28

This is my way of play a Vimeo video inside a app.

I am using iFrame to load Vimeo video inside my app.

follow this steps and you will too.

create a uiwebview and connect it to your .h file. Mine is _webView.

Add this method to your .m file.

-(void)embedVimeo{

NSString *embedHTML = @"<iframe width=\"300\" height=\"250\" src=\"http://www.vimeo.com/embed/rOPI5LDo7mg\" frameborder=\"0\" allowfullscreen></iframe>";

NSString *html = [NSString stringWithFormat:embedHTML];

[_webView loadHTMLString:html baseURL:nil];
[self.view addSubview:_webView];
}

I am using the embedded code in Vimeo video. (I hope you know what it is)

call this method inside your viewdidload

[self embedVimeo];

Run the app and you will see the video in your view. This way is perfectly working for me and i think this will help for your too.

查看更多
叛逆
3楼-- · 2019-03-09 19:33

It appears that vimeo is transcoding all videos being uploaded these days into versions compatible for the iphone which are used on their site when you browse from an iphone or ipad. You can however call their videos into an HTML5 player on your site by doing some simple tricks found here. If you can host a page on your site somewhere, you can load the video into a UIWebView and it should all work. Vimeo's only limitation is that there embed code is flash but the video infrastructure is all there for HTML5. Hope this helps!

查看更多
Juvenile、少年°
4楼-- · 2019-03-09 19:33

This is the code to embed the vimeo video in a UIWebview

<iframe src='http://player.vimeo.com/video/12345678?title=0&amp;byline=0&amp;portrait=0' width='320' height='480' frameborder='0'></iframe>

here 12345678 is the video id.

Sadly my app got rejected for embedding HQ vimeos in a UIWebview in the app.

查看更多
神经病院院长
5楼-- · 2019-03-09 19:38

I'm not sure if this is possible - Vimeo uses flash.

However according to this

http://news.cnet.com/8301-27076_3-10394769-248.html

Some videos in the Vimeo collection have been converted to be playable on mobile devices that don't support flash

查看更多
相关推荐>>
6楼-- · 2019-03-09 19:40

According to Vimeo forum at the moment the only way is to link to a mobile URL like

vimeo.com/m/#/id

they say they will add API to search mobile video content more info on http://vimeo.com/forums/topic:20132

查看更多
等我变得足够好
7楼-- · 2019-03-09 19:41
NSString *htmlString = [NSString stringWithFormat:@"<html>"
                                @"<head>"
                                @"<meta name = \"viewport\" content =\"initial-scale = 1.0, user-scalable = no, width = 320\"/></head>"
                                @"<frameset border=\"0\">"
                                @"<frame src=\"http://player.vimeo.com/video/%@?title=0&amp;byline=0&amp;portrait=1&amp;autoplay=1\" width=\"320\" height=\"140\" frameborder=\"0\"></frame>"
                                @"</frameset>"
                                @"</html>", 
                                videoID];
查看更多
登录 后发表回答