Youtube ios player helper can't play video - ios

I am using this library https://github.com/youtube/youtube-ios-player-helper
in my project. The player works well if I use the video Id given by the sample (M7lc1UVf-VE). If I use the video Id from r random video on youtube it shows:
An error occurred, please try again later. Learn More
Do I need to enable a youtube data API or something like that???
cause I see another IOS Youtube helper needs to do so.
https://github.com/youtube/yt-direct-lite-iOS
Thanks.

add this in your playerVars #"origin" :#"http://www.youtube.com" it will work.

If you only want to play youtube video, no API access is needed.
I work on with this library without any error, did you replace "M7lc1UVf-VE" with the correct video id?

Related

youtube and other video links not played in chromcast ios app

I am working on an ios app where I need to play youtube and other websites's video in app as well as need to cast it on chromcast. I have followed Google's official code example from here https://codelabs.developers.google.com/codelabs/cast-videos-ios/#0 I am able to play several video links which has extensions like .mp4 but not able to play youtube video url.
working url :-
http://www.html5videoplayer.net/videos/toystory.mp4
but can't play youtube link like this
https://www.youtube.com/watch?v=WfV-0Yv5vNY
I am passing video link and other data in bellow code when user tap on play button while the chromcast it connected.
GCKMediaInformation *mediaInformation =
[[GCKMediaInformation alloc] initWithContentID:
#"https://www.youtube.com/watch?v=KgNSAXGVY8A"
streamType:GCKMediaStreamTypeNone
contentType:#""
metadata:metadata
streamDuration:0
customData:nil];
[_mediaControlChannel loadMedia:mediaInformation autoplay:YES playPosition:0];
My chromcast receiver type is default and I am using this key "kGCKMediaDefaultReceiverApplicationID" for casting on default receiver.
I have searched so may question for this issue but almost all the questions are related to android application.
so can anybody tell me whats is wrong with this? also I want to know that should I need to use custom receiver for youtube video player or I can use default one.
any help will be appreciate.
You cannot use the YT urls, like the one you have mentioned, in a default receiver for casting purposes. If you insist on playing YT videos in your own receiver, you'd need to write a custom receiver and embed a YT player in your receiver and handle communication with your receiver yourself. There are also limitations to this solution; for example you cannot skip ads, etc.

using livestream video in iOS application

I want to use video from some live streaming channel i.e. twitch, youtube in my iOS application without using their plugins. How can i do so?
I'm trying to get url of the video so that i can play it via moviePlayer or something else in my application. At the moment, i'm using OBS for uploading the live-stream on twitch.tv
I've found the following link, but again i'm unable to find the url of the video so can't use the solution mentioned How can I use Livestream player in iOS/Android app?
Thanks,
I have solved the issue using webView. For Youtube we've stream id and we put it in url as "https://www.youtube.com/watch?v=videoId".
For ustream i made url as "https://www.ustream.tv/embed/channelId".
If you don't want to use webView then you can use helper libraries for these platforms i.e. YTPlayer, twitch etc.

Get streaming URL from any YouTube video

I know about how to play video in device. But Here I just want to know that is it possible to get streaming URL from any YouTube Video? Then how can I do it, I tried to search on google but I can not able to find my solution.
Generally I does not want to play direct stream from video, actually I want to save this URL (stream) in my buffer memory OR whatever temporary file and whenever user click on particular button then particular URL Stream is play.
Al Last I got YouTube APIs + iPhone = Cool mobile apps. But I am not sure that it's helpful in my case or not ? If anybody who worked on this API then please suggest me, Otherwise How can I get streaming URL.
Your suggestion will be appreciated.
Thanks in advance.
http://www.youtube.com/get_video_info?&video_id={VIDEO_ID}
This will not work on all files, some will display the message "This+video+contains+content+from.....". But many will work.
Is it possible to get streaming URL from any YouTube Video? - No, it is not possible without hurting the terms of service of youtube. Google has built the business model of youtube around the advertisements all over youtube, in-video banners and video ads and they want your user to see their ads. This is the reason they completely hide the video stream and would ban your app if you anyway access and stream it directly.
The only consented way to play youtube videos on iOS is to embed it into an iframe of a web view.

Can I get youtube video as mp3 sound in iOS ?

as mentioned in the question
Can I get the youtube as sound file with any extension
I mean specifically with using JSON or any other way ?
One way to get songs from Youtube is to use their API, and search for your song. It will return a youtubeID url of video/song.
You can then stream this into an iOS app.
A handy framework to extract video url from youtube ID url, is LBYoutubePlayer which can be found here https://github.com/larcus94/LBYouTubeView
You would then need to extract the audio from the video.
Technically, that could all work. Not sure if it goes beyond Youtube's terms and services though.

Phonegap Video player plugin for iOS [duplicate]

I am using a Phonegap plugin for playing a video in my iOS app. I'm able to play a video with the URL format like http://easyhtml5video.com/images/happyfit2.mp4.
How do I play Youtube videos using the phonegap-videoplayer-plugin?
YouTube Terms of Service: "You agree not to access Content
through any technology or means other than the video playback pages of
the Service itself, the Embeddable Player, or other explicitly
authorized means YouTube may designate."
There are some methods that will give you direct link to youtube videos. Use "gdata" option to find all possible video formats.
Then parse the result to get desired link. Hope this might be useful
But everywhere I found the code to be edited in .m and .h files. None have explained how to use it.
That's because you can only directly use MPMoviePlayerController from native apps (written in Objective-C). For any other technology you'll have to have an intermediary layer in between.
From googling, I found this plugin for PhoneGap that claims to integrate with MPMoviePlayerController. I've no idea if it's any good, but it might do as a starting point.
try to give the youtube url in this format.
http://www.youtube.com/embed/jxXukpxNSx4
You will get the desired result. But Autoplay is not enabled, as Apple stopped supporting autoplay to save user's bandwidth

Resources