How to play just the audio of YouTube Video? - ios

In my app I have played a youtube video by embedding it, but how can i only play the audio of the video? I tried using AVAudioPlayer and use the videos url as the file path but it didnt work, any help?

No it is not possible, only one workaround is just to use a hidden UIWebView and play in that.
Youtube forbids playing audio only! here is the message from youtube
Your API Client will not, and You will not encourage or create functionality for Your users or other third parties to: "separate, isolate, or modify the audio or video components of any YouTube audiovisual content made available through the YouTube API"
-Kuan Yong, YouTube API Team

Related

react-native-video play Vimeo and YouTube

I wonder if it is at all possible to play Vimeo and YouTube via the React Native component react-native-video. My research so far points to this being virtually impossible, because react-native-video needs a direct reference to a file (or a stream?) and these references are hard/difficult to obtain for YouTube and Vimeo?
Is there any way to get react-native-video working with Vimeo & YouTube?
react-native-video will work with Vimeo, if you subscribe to Vimeo Pro.
Vimeo Pro offers the ability to use your video own third party player, which lets you get the url for your video in 360p, 540p, 720p, or 1080p specifically or as an HTTP Live Streaming url which can choose the correct resolution/bitrate for the user's connection. react-native-video work with any of these formats!
I know a github project which is a Youtube component for react-native. Check it out, maybe it can help you ;)
Here you have an other project for Vimeo videos

Getting the url of the youtube video

Is there a way to get the youtube video without the youtube player? The youtube player sdk - https://developers.google.com/youtube/android/player/
uses the existing youtube player, I need the url that it uses to play the video, so that I can use my custom video player. More of using youtube as a hosting service, where I can pull the videos from the server from which youtube player pulls it. Don't know if it is possible or legal.

Can we PLay Youtube audio only inside app?

I am working on an app, where I am required to play the youtube's Audio and Video as well.
I am able to PLay video Using "XCDYouTubeVideoPlayerViewController" available on cocoa controls. (I am getting Youtube url from the backend)
Is there any way , where I can play audio also only inside my app. Because I checked over Internet and stackoverflow, but Couldn't find anything working.
And Is there any way, where the Video or audio can be played at the Back gorund , i.e when I press Home button the vidoe/audio keeps on playing.
All I fund on stack overflow is, that its forbidden, and the chances are your app will be blocked.
Please help, Thanks Again.
Youtube doesn't encourage audio only! here's what they have to say about this.
Your API Client will not, and You will not encourage or create functionality for Your users or other third parties to: "separate, isolate, or modify the audio or video components of any YouTube audiovisual content made available through the YouTube API" -Kuan Yong, YouTube API Team
However there's a hacky workaround workaround whereby you can use a hidden UIWebView and play in that.

Playing YouTube audio stream in Third Party App

I'm developing an application in which I would like to play YouTube audio stream (without video). Does it violate any term of service of YouTube?
Thanks in advance.
Here's a link to the YouTube API terms of service:
https://developers.google.com/youtube/terms
The answer to your question is in section II, parts 8 and 9, stating it is prohibited to:
separate, isolate, or modify the audio or video components of any YouTube audiovisual content made available through the YouTube API;
promote separately the audio or video components of any YouTube audiovisual content made available through the YouTube API;
So it's a no-go, unfortunately.

How to play video in streaming by using iOS GoogleDrive SDK?

I want to play video in streaming by using iOS GoogleDrive SDK.
GoogleDrive App in iOS app store can play video in streaming by YouTube.
I have seen this post:
http://apiblog.youtube.com/2009/02/youtube-apis-iphone-cool-mobile-apps.html
According to the post, the key of play video is the YouTube source link.
The link lists GoogleDrive's all of file properties:
https://developers.google.com/drive/v2/reference/files
All file's properties were tried to instead of the YouTube source link, but that doesn't work.
Could anyone tell me how to get the correct link to play video by YouTube?
Thank you very much.
You can the URL in the embedLink field to get a streaming player for the video.

Resources