Does Apple Company allow for apps to stream video from youtube? - swift

I need to write app(on swift) that streams video using url! So, My question is , can I write player that take url from youtube? Does Apple allow this ? Searching on internet I found only Media Framework . However this frame work only uses url that directly points to the video (like http://someserver/moview.mpg4)
On youtube , there is no direct link to the videos.
So can someone help me to answer:
Does apple allow youtube streaming?
if yes, what framework to use?

Yes you can 'embed' YouTuve video playback in your app - YouTube provide an API and details here:
https://developers.google.com/youtube/v3/guides/ios_youtube_helper
You will see it uses a UIWebView which is a common technique to bridge web and native app technologies.

Related

How to play vimeo videos inline in moblie application and grab seek, play events

We are developing a mobile application (using ionic framework, jquery) and thinking to let our users to share videos from vimeo, youtube etc. in this case we are integrating vimeo video link in iframe. Below are challenges:
Not able to play vimeo videos inline in our application:
on iPhone device when we play vimeo video from our ionic application it opens in a native video player, on the contrary we want to play it inline in our application itself
in case of Youtube video its supported and works well. They have provide Playsinline property to support it.
As per vimeo developers documentation, we have not found any similar video player property to allow inline video rendering
Is there any workaround that you suggest to play vimeo video inline inside application?
Play, seek & load progress events are not supported in mobile application
As per your developers page, play, seek, load progress etc events are not supported in mobile application
Is there any workaround to enable these events on our mobile application
Yes, I know there are limitations that vimeo has declared but can someone provide me if there are any workarounds? Your response to our queries is very much important for us.
Reference:
https://developers.google.com/youtube/player_parameters
https://developer.vimeo.com/player/js-api#event-compatibility
try adding background=1 to your embed code
<iframe id="player1" src="https://player.vimeo.com/video/[video id]?api=1&player_id=player1&background=1" width="630" height="354" frameborder="0"></iframe>
This wil not work in browsers which revert to the flashplayer.
I don't know if you'll have javascript API functionallity.
This will remove all controls aswell. What I've read, it's still in an experimental fase, but hope it works for you.

Playing video from youtube link without UIWebView

I want to play a video in my app from youtube link e.g: http://www.youtube.com/watch?v=Uner-3tTY1I.
But i don't want to redirect the user to any web view in the app. Just want to play that video in the video player in the current view of my application.
Is it possible to play the video without redirecting to UIWebView? If possible, how can i do this? Thanks for the help in advance.
The only allowed way seems to be using UIWebview. Doing it other way will violate youtube copyrights.
However there are few open source libraries out there. You can use it at your own risk.
Just use XCDYouTubeVideoPlayerViewController. It uses progressive download + MoviePlayer and AVFoundation frameworks.
To play this video you need to have the link to the video stream that is associated with video you want to play. Unfortunately this isn't so simple to get this link for some movies on YouTube since this link can be encoded for some movies (channel VEVO for example). Read this for more information about encoded links http://www.jwz.org/blog/2013/06/youtube-download-counter-countermeasures-applied/.
Unfortunattely as for now there is no simple way to decode these links. Despite this, you can get the source link for the not encoded films without bigger problems using some calls to the YouTube Api.

Can a iOS app load a webview with youtube?

I am developing an iOS app. In that I am loading couple of youtube videos using HTML5 using webview.
I am bit concerned about the fact that apple will reject the apps that are loading some big videos directly without HTTP live streaming.
So, is my approach wrong? Shall I load youtube video directly? Is the youtube providing HTTP livestreaming by itself?
I am curious to know these stuffs.
Thanks.
It's fine to load the YouTube video in HTML WebViews. Many apps do it this way.
The key thing to remember is that you are not allowed to autoplay videos, they have to be user initiated i.e. they have to press the play button.
Edit:
Please check this official page

Download youtube video through gdata-objectivec-client

I am developing an iphone app in which i have to integrate the youtube api.
I am using gdata-objectivec-client library for iphone
http://code.google.com/p/gdata-objectivec-client/
I am able to search, like, dislike, upload video etc. through this library but i don't know how to stream and download the video from youtube using this library as there is no class for this.
My question is that is it possible to download/stream the youtube video through gdata-objectivec-client library?
Thanks in advance.
You cant download youtube video using API. Its against thier Terms and conditions.
But streaming is possible i think.
Check this post
iphone:How to stream and play youtube video with in application using MPMoviePlayer?

Can we play only audio using youtube api for iPhone

In my project i have to use youtube api and play only audio of the video. We must not show the youtube player. Is it possible to play only audio without showing video using youtube api?
Extraction may be the incorrect implied word here. From what I understand, is user133611 wants to have an audio only stream from YouTube. Unfortunately, YouTube directly forbids it. Here is a quote from Kuan Yong from the YouTube API team:
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
Link reference: https://groups.google.com/group/youtube-api-gdata/browse_thread/thread/7fac8e8ff913b6c4?pli=1
I don't think this is really possible only using Youtube API. The Youtube API is not intended to be used for "downloading" videos/audio from them. You should go here, to understand what the Youtube API is really about.
A small abstract:
Unless I am missing something really big, the Youtube API consists of 5 main parts:
Data API
Custom Player
YouTube Direct
Player APIs
Widgets
None of this APIs allow you to for example "download" a video. Also I think (correct me if I'm wrong), that in a youtube video, the audio is actually embedded in the flash video, making the task even less trivial.
To illustrate you, the Data API, allows you to perform and use the youtube video search capabilities, use playlist capabilities and many more of the operations available on the YouTube website.
That have being said, the Youtube API, can be used for example to upload a video from your iPhone to youtube, as this example illustrates.
My Thoughts:
I think that extracting the audio from a youtube video, is actually possible, but involves a whole different process of downloading the video in H264 and then extracting the audio... but it still involves downloading the whole video.
Is the audio only prohibition still valid? Streamus is available as a Chrome Extension. It streams audio only from YT - see website https://streamus.com/
Well, one can simply give the video a width and height of 1px, or better yet do:
.video { text-indent: -9999px; }
And then force the video to play via the API controls. But I wouldn't do it as it is against their TOS and would result in my app being blocked if they find out.
I really confused about your platform. Do you want to do it over iOS platform with writing native code? If yes, you can do it without playing video. But you have to stream both video and music. You can do it with AVAudioPlayer Class, check the reference from
https://developer.apple.com/library/ios/documentation/AVFoundation/Reference/AVAudioPlayerClassReference/
But yes, you will makes users GSM data overload and it's not fair with letting users about that situation.
Maybe you can force your view over the youtube view? Have you tried that?
If it is against TOS, the op should just drop the idea of implementing his idea.
Just imagine the free music everyone will be streaming out of the promo videos of major videos on youtube!