Playing youtube/vevo videos on iOS - objective-c

I've seen the Google blog article explaining the way to embed youtube videos in an iOS app. I've successfully embed videos in my iOS app. BUT, I've seen the WhoSampled app where they are able to play Vevo/youtube videos. Somehow they are able to play those videos and my app is not able to play them. (In my app, there is a blue play circle with a line through it showing that is not playable.)
How do I allow those videos to be playable?
Do I have to setup the youtube link in a specific way or is there a way I need to setup the developer key?

There is a way to get the actual video stream for a given YouTube video instead of the HTML-embedded one. See this project:
https://github.com/hellozimi/HCYoutubeParser
The problem with this approach is that it will likely violate the EULA of YouTube APIs, especially if you are releasing it in a paid application:
In addition, please remember that attempting to play a YouTube video outside of either the YouTube embedded, custom or chromeless player is strictly prohibited by the API Terms of Service.
(source: https://developers.google.com/youtube/creating_monetizable_applications)

You just have to use the iframe embed as opposed to the Flash one.

Related

YouTube iframe API allownetworking=internal

I'm including YouTube videos in an iPad app (cordova).
For the nodewebkit desktop version, I could easily disable clicking through the video to youtube (and therefore being stuck there with no way to get back to the app) by adding allownetworking="internal" to the object embed code.
However, flash does not work on the iPad & this attribute seems to be ignored for the iframe API. What are my options? Is there a way to do this?

using VideoJS VAST plugin without video content

I want to display ads with VAST ad tag and with a HTML5 player. I'm currently trying to use videoJS with Vast Ads Plugin and I'm noticing I can't get the videoJS player to work without having a video content (video element with a src attribute for the video content).
Does anyone know a simple way to use a video player for just ads from VAST, and without video content? Google IMA3 SDK allows that, but I'm now looking for video plugins to cover IE use case (which Google IMA3 SDK does not cover).
Thank you!
There is a dirty way to do this. You can get the ad video url from the plugin that already parsed by it. Then just paste as src to video tag.
If the player you are using support only running pre-roll, that's obviously the best choice. Since that's likely not the case, I would recommend creating a small 1 second long black video MP4 and setting it as the content, with all video controls disabled. This was the lowest friction solution for me, as I didn't need to ask the player anything special of the player. The pre-roll plays, and the user briefly sees black at the end, which may not really be noticed.

how to control an embedded <iframe> (any) video?

I would like to be in full control over Embedded videos, just as like as i can control my owned videos.
By "control" i mean by commands, such as -
iframeId.play();
iframeId.pause();
iframeId.currentTime();
I've seen its possible with YouTube videos, they share they're API.
But is it possible with any flash video i embed?
can i find it's API somehow?
if i cannot, can i work on any other solution (to control embedded vids) in any other way? how?
You should use YouTube IFrame API to control YouTube videos which are Iframe, AS3 or AS2.
Here is the full reference page for it: https://developers.google.com/youtube/iframe_api_reference
Also you can use Javascript API or Flash (Raw) API
Don't forget to use the YouTube player by the rules (I mean, you shouldn't hide the player or sth like that.)
Good Luck ;)

Play brightcove videos

I want to play a remote video hosted in Brightcove. As Brightcove URLs are links to players not direct links to video files the AVPlayer won't do it.
I know Brightcove provides an API but can't find any good examples for iOS nor documentation.
Any help/pointing direction appreciated.
I haven't used Brightcove, but poking around their site, I see they have two APIs: a Player API and a Media API. It sounds like the Media API is what you want — it's documented as giving direct references to the videos. The page has a link to several examples.
You can also lift alot of the code from their Oneplanet demo source. In fact the whole playlist and video player mechanism can be practically copied into your project so all you need to do is pass a video or playlist ID into their initwithnibandplaylist function in their view controller and you're good to go.
I hope this helps your question. There is a renditions which contain direct video link.
Here is a link for api link.
http://support.brightcove.com/en/video-cloud/docs/accessing-video-content-media-api
renditions is a javascript object containing multiple video links based on resolutions such as 360,460, 720.
You can find the direct link to the video via the media api, bypassing the player API entirely. You need a pro account and a token:
http://support.brightcove.com/en/docs/getting-started-media-api
Alternatively, you can create a simple "player" without any controls (just a video window actually) and make your own HTML controls totally outside of Brightcove to trigger almost anything you'd want to do via the player API.
There is also a Brightcove iOS SDK. It is really two SDKs one for the Media API and one that includes a MediaPlayer. If you want to use the AVPlayer you can use the Media API iOS SDK. Here is the docs for that:
http://docs.brightcove.com/en/video-cloud/mobile-sdks/brightcove-player-sdk-for-ios

How can I post a video, via Facebook's Connect API, to my Facebook profile page?

Has anyone posted a video via the Facebook Connect API to their profile / feed page?
Ideally, the video should be queued to the first frame with the superimposed Facebook's blue right arrow "play" button. Or if a thumbnail representing the video has to also be uploaded (rather than the video being queued to the first frame) as well, this is fine.
Also, when the video, or thumbnail, on the profile page is clicked, the video plays where it is - rather than going to another page off Facebook to be played there.
The question may have not been correctly worded. The term "API" was misleading to a couple of folks - and I apologize for that.
What I was trying to do was to "share" a video by linking it in Facebook, AND to have it play in the profile feed (ie. to not leave the Facebook site while viewing the video - just like YouTube and Hulu.com do).
After digging into the JavaScript that Hulu was using to get this behavior, we noticed that a link tag was missing between our version of the <meta> and <link> tags, and Hulu's.
Facebook's web page, http://www.facebook.com/share_partners.php, was missing a tag that you should have if the content is a video, and you want it played in the profile feed.
Along with:
<link rel="video_src" href="http://www.example.com/player.swf?video_id=123456789"/> ...
You should include:
<link rel="media:video" href="http://www.example.com/player.swf?video_id=123456789"/>
That will get it to play in the feed. BUT, your domain name must be whitelisted.
To get your domain whitelisted, fill out this form: http://www.facebook.com/share_partners.php#/developers/developer_help.php
I got a reply, and approval, within a day! Kudos to the Facebook developer support staff!
Use the Video.upload as described by stevedbrown or the Stream API or if you want to go simple share the link via API or share link.
Have you read the Facebook developer wiki page on this? That explains what is possible and how, it's pretty decent.