i need to put videos taken from a specific vimeo album. The videos are private (hide from video) so i need to use the advanced api but it seems that OAuth needs an user click to proceed. How can i show directly the videos?
First, if you are starting now I would recommend the new API
Second, if you are only ever using a single user you can just hard code your authentication into your app. Vimeo's documentation describes this feature in more detail.
Related
I'm working on an app that uploads private videos to Youtube to be viewed by everyone at our organization. Luckily, Google and Youtube have an awesome company-wide permission for this, which allows for anyone with an email address within the company to view these videos.
Youtube has 3 options for video privacy status: Public, Unlisted and Private. I'd usually just go with Unlisted and call it a day, but due to the nature of these videos, I'd prefer for them to Private, then manually grant access to the video and share it with everyone at the organization. When done through the Youtube Video Manager page, here is the dialog box I'm looking for an API endpoint for:
Manual Approach
We can go through each video and check this box in each video, but that's not something that scales well. I'd love to find documentation on a Youtube API endpoint that handles this. There's a clear status.privacyStatus attribute for videos that can be set to private, public or unlisted, but nothing for this.
Does anyone know of a Youtube API andpoint to control this permission for private videos on Youtube?
I can back up the assumption from my comment that private video sharing is not possible through the Data API v3 with this article I found on the topic.
The author of the article even provides a workaround to this problem, although I strongly discourage using it, since it requires parsing sensitive account information (password) in PHP. Apart from that, the code is from 2010 and will most likely not work anymore because it is from before YouTube channels were linked to Google+ pages.
I've read YouTube's Terms of Service several times and have Googled this question tirelessly with no concrete answer. This is not a legal question about my specific YouTube API client, I just want to know if any YouTube developer has used the API in this way. I'm working on a side project for myself that's essentially an Instagram-YouTube mashup. I am a YouTube developer with an API key. Can my API client store a videos title, description and id in my database when my users like a video on my client? I don't know how else I can keep track of my users liked videos within my client.
Since you already specified that this is in fact not a legal question, the short answer is: Yes, you can (meaning it is possible).
There is one more possibility coming to mind, though:
You could authenticate users via OAuth 2.0 using the https://www.googleapis.com/auth/youtube scope. That way, you can manage their liked videos and add/remove videos to this list when a user clicks the according buttons on your website (you can also check if any given video is already liked by the user). In this case, all the track-keeping is done by YouTube itself. This ultimately means that whenever a user likes a video in your app, they also like it on the YouTube website. This may or may not be desired, it is for you to decide that.
I have searched the web for tutorials and instructions but could not find any on this... So I was hoping maybe someone here can point me in the right direction or just link some good tutorials. (By the way I am willing to make a basic YouTube client app which lets the user search for videos and than watch them...nothing too fancy).
Thanks in advance!
Oh buddy.... welcome welcome to the world of parsing JSON files and putting up with BADLY documented APIs :)
Well I was looking into this a few months ago and I managed to get it working. Here are the things you have to do:
Step 1 - OAuth 2.0 Integration
Will your app allow the user to login to YouTube so that they can comment/like/etc... videos? If so, then you will need to get the user to login to the YouTube API via your app first before they can do these kind of things. In order to do that, your app will need to use OAuth 2.0 to communicate with the YouTube API. Here is a superb library which you can use to authenticate with the YouTube API via OAuth 2.0: https://github.com/BHughes3388/BAHYouTubeOAuth
Step 2 - Keychain - Access Token storage
If you are new to OAuth authentication, then it can be daunting at first, but once you play around with it and familiarize yourself with it, you will realize that it is very easy to work with.
So overall, the way it works, is that your app contacts the API (in this case YouTube V3 API) and requests a webpage. The webpage allows the user to login to the APi and grant your app access. Once this has been done, the API will send your app an "access token". This token will need to be used in all (or most) of your API requests (it depends on the type of request).
Once you have obtained the "access token" you will then need to store it securely. Its basically a password, so you need to keep it safe. Do not do what some people do, which is to use NSUserDefaults, that is not secure at all. Instead you will need to use Keychain. This is Apple's secure encryption/storage library which can easily be used to save secure strings such as passwords.
In order to use Keychain to securely store and retrieve the "access token" when you need it, take a look at this SO post, its great: How to use Keychain for saving password like GenericKeychain sample code
Step 3 - YouTube API V3 - https://developers.google.com/youtube/v3/
Right so now, the harder bit. You need to read through the Google YouTube API V3 and go through the API reference documents to find the specific URLs which will return the data you are looking for. For example: if you want to get a list of videos from the home feed of a user or from a simple search, then take a look at this API reference page: https://developers.google.com/youtube/v3/docs/videos/list
Step 4 - Extract the video URL
Before I talk further about this step, I should mention that Google says you should present videos in a simple webview with YouTube HTML code which simply embeds the video view in your app. But in my opinion (and many other devs), this looks and works horribly....
So if you want to display YouTube video in your app via the native MPMovieplayerController, then you will need to extract the video URL first before you can do this.
When you make a request to the YouTube API for a set of video(s), you will get a JSON file back, this file contains a list of videos (videoIDs, titles, dates, etc....).
You will need to parse the JSON file for the video IDs. Once you or the app user has selected the video that they want, you will need to use then pass the video ID for that particular video to a "YouTube video link extractor" library. This library will then return a set of video file links for that video. These links can be used in conjunction with MPMovieplayerController to display the video natively.
Here is a great YouTube video file url extracter - https://github.com/runmad/RMYouTubeExtractor
Good luck :)
Utilising YouTube Direct so that users can upload video's for approval directly to my site.
1) All the approved videos will be displayed in some form of gallery on the site.
2) All registered users will be able to view thus galleries.
My Question:
Is there a way to limit or restrict access to the actual embed code of those playlist/ gallery video on my site?
We would like to make it so that all users can view all videos on the site but a (business users - who wants to embed a video on their own site) they must have access rights supplied by our company first.
In basic form. If a business user wants to use/ embed a piece of video content which has been generated through our site to use on that companies own site - they must be a paying subscriber.
Therefore is there a way of limiting access of the embed code to certain users?
Appreciate any help. :)
YouTube videos can be public, unlisted, or private. There's a discussion of private and unlisted videos in the general YouTube help center.
There's nothing specific in the API that gives you access to other options beyond what YouTube supports.
I've noticed that some recent tweets have media associated with them, for example photos from TwitPic or Flickr and videos from Youtube. You can see them on the Twitter website directly, so it's more than just a link. My thinking is that Twitter has formed these partnerships with these select suppliers of media, being Flickr, Twitpic and such.
I'm looking to automate some tweeting from an image gallery. Yet, I do not wish to upload these photos to another place. I want to host them myself and then embed/refer to them from a tweet. Yet, they should also be seen inline.
Is such a thing possible?
2017 edit: Looks like you can get a media_id via POST media/upload and then pass the id into POST statuses/update.
2014 edit: You can add media to tweets using POST statuses/update_with_media.
Original 2011 answer: No, you can't embed media into a tweet, nor can you upload photos to Twitter.
The "embedded" media you see is just Twitter scraping the URL for the photo or video, and showing it directly within Twitter, saving users from needing to click on the link to view the media. And Twitter only scrapes media for certain popular sites.
If you want Twitter.com users to see your images inline, you'll need to upload images to one of the popular image sites you mentioned, and have its URL in your tweet.
If you still want to drive traffic to your site, you could also include your gallery's URL within the same tweet.
But keep in mind that not everyone uses Twitter via Twitter.com; there are a plethora of Twitter clients available, and I doubt many feature inline media scraping.
I'd suggest just linking to your gallery/images, and not worry about uploading them elsewhere.
You can do all this and more. (and Twitter DOES allow you to upload images). Look at the documentation for Twitter cards.
https://dev.twitter.com/docs/cards