Is there a way to get the URLs of videos that are included in the Photos library?
I want to compare them to a table view list, then pick and play that video.
If you're using the newer Photos framework (which you should unless you're still needing to support < iOS 8) and your goal is to simply compare items retrieved from the photo library for uniqueness, I'd recommend fetching PHAssets from the PHPhotoLibrary and using the PHObject's localIdentifier getter to compare the items.
If you're not using the Photos framework, you can also use AVAsset's URL property to get the local file path for a specific AVURLAsset.
Related
Can anyone guide me on how to get youtube's API's to play songs inside the app ?
I need to implement a view with UISearchBar where the user searches for any video on youtube (channel etc .. ) and the results are filtered in a UITableView with the thumbnail, title, and description.
The user gets to choose a video and this video gets opened in another view.
I just need the search because i've been searching for a week and i can't find any result.
PLEASE help.
Thanks.
Youtube api has a good tutorial page for their iOS helper library that you can find here.
In order to retrieve youtube videos using a search string, you'll need to use the youtube api.
You might have to make a get request to
GET https://www.googleapis.com/youtube/v3/search
The required parameters include
part -The part parameter specifies a comma-separated list of one or
more search resource properties that the API response will include.
Set the parameter value to snippet.
You may want to add the search string parameter as well (q), if you are searching for a particular string .
For example a query looks like:
GET https://www.googleapis.com/youtube/v3/search?part=id&q=hello&key={YOUR_API_KEY}
and you get the JSON response containing the youtube ids for the videos matching the search string provided.You can see the details here.
This youtube id can then be used to play the video in a Web View according to the iOS helper library.
[self.playerView loadWithVideoId:#"M7lc1UVf-VE"];
I am using the Python SDK to upload videos on dmcloud.net.
Now I want to give the user of my application the possibility to choose a thumbnail to the video he uploaded. How can I generate different thumbnails from an uploaded video on dmcloud.net.
Thanks.
Through the SDK, you can update the video thumbnail using the set_thumbnail method of the Media API. You have two options:
Specify a URL to a new thumbnail
Specify a timecode, which is a time offset within the video
For your end-users, provide a way to let them specify a URL or an offset (verify it's an offset that's appropriate for the video's duration). If you're using a custom player, you can probably let them choose an offset visually by pausing the player on their frame of choice and then extracting a time offset from your player for the dmcloud API call.
If you choose to set a thumbnail by timecode (offset), the SDK call would look like this:
cloudkey.media.set_thumbnail(id, timecode)
SDK Link: http://www.dmcloud.net/doc/api/python-sdk.html#media-object
I'm developing an application and I'd like to list the images present in the "Documents" directory of my application (to load images using iTunes) and I'd like to list the images and photos taken by the Camera as well.
And I do know about UIImagePickerController, but I don't need that. I want to integrate the photos and the loaded application images in the same place. But I can't find any information about where can I find all the device camera photos.
Thanks in advance
You can access all the photos stored in the photo library using the Assets Library Framework. Check out the documentation here:
https://developer.apple.com/library/ios/#documentation/AssetsLibrary/Reference/AssetsLibraryFramework/_index.html
Specifically, you want to use ALAssetsLibrary's enumerateGroupsWithTypes:usingBlock:failureBlock: to enumerate the ALAssetsGroupSavedPhotos type, and enumerate the photos in that group with ALAssetGroup's enumerateAssetsUsingBlock:.
Some links with sample code:
http://www.icodeblog.com/2010/07/08/asset-libraries-and-blocks-in-ios-4/
http://www.fiveminutes.eu/accessing-photo-library-using-assets-library-framework-on-iphone/
I am writing a Boxee App and I want to list all albums for a picasa account.
The problem I'm facing is that I have no idea of how to list albums and photos in the Boxee app.
The application itself should be fairly simple:
First a main screen where all your albums are listed, then when you click an album you see all your photos in a grid of say 4x5 photos
When you click a photo you go in to a view where one photo is displayed on the whole screen where back and forward lets users go back and forth in that gallery.
I have wrote a simple wrapper arround the gdata photos Python API which I was aiming to use so hopefully all the heavy lifting will be done by the gdata API.
Does anybody have some good links to example applications or tutorials to one or more of the features I want in the application?
Boxee uses an XML based approach for describing an application's interface. You'll need one XML for each screen of your application and you'll connect them together using the API.
You would build this XML screens using various controls defined by the XML API. Basically a control (a button, a list, a label, etc) is described as an XML node with attributes and child nodes. You can check a list of all the available controls here: http://developer.boxee.tv/UI_Controls
You can use the Python API to control various properties of the UI elements you coded in your XML files. For example you could fill a list with photos taken from a server, you could change the label on a button, load another screen and much more. Here are the Python API specs: http://developer.boxee.tv/Python_API
Make sure you read trough the Boxee dev pages and also remember that Boxee originated from the XBMC project so most of the documentation regarding XBMC skinning (http://wiki.xbmc.org/?title=Skinning_XBMC) also applies to Boxee.
Another thing that might help you is looking at other apps. Find an app that is somehow similar to what you want to do, find it in Boxee's app folder and peek at the code there.
I want to download all my favorited photos from VK, but I couldn't find suitable method in documentation. User's faves are not album and it makes troubles. Is there a way to do what I want?
You should use method fave.getPhotos to get pictures available here.
Access items from response and extract picture link from fields photo_807, photo_604, photo_130 or photo_75 dependent on which size do you need.
You can download images using the links extracted.
https://vk.com/dev/fave.getPhotos?params[photo_sizes]=0¶ms[v]=5.67