How can I tweet videos from an iPhone app programmatically ?
(the absence of programmatically caused me 3 vote downs :D)
Is there a way I can attach a video to a tweet ? Or should I upload the video somewhere else and just tweet the link ?
Any guidance in this regard is much appreciated. Thanks.
You need to upload the video, then link it in. You can't really 'attach' anything to a tweet.
i have same question, how to attach video to tweetsheet programmatically. only found code for setting tweetsheet text, image, or url link. looks like need to upload the video (eg. to amazon s3), then add video's url to tweetsheet ->
[tweetSheet setInitialText:#"Tweeting from my own app! :)"]
if (self.imageString) {
[tweetSheet addImage:[UIImage imageNamed:self.imageString]];
}
if (self.urlString) {
[tweetSheet addURL:[NSURL URLWithString:self.urlString]];
}
i checked the following tutorials/docs:
raywenderlich tutorial
(http://www.raywenderlich.com/21558/beginning-twitter-tutorial-updated-for-ios-6)
appcoda tutorial
(http://www.appcoda.com/ios-programming-101-integrate-twitter-and-facebook-sharing-in-ios-6/)
apple docs
(https://developer.apple.com/library/ios/documentation/NetworkingInternet/Reference/SLComposeViewController_Class/Reference/Reference.html#//apple_ref/doc/uid/TP40012205)
Related
how to share .gif image in Facebook from my ios app?
i have tried png and jpg format it works .
but when i share .gif file.
it will just share as normal image not as an animated image.
so if anybody had try it. please help me out to find solutions.
Source: Guide to Animated Gifs for Facebook
If you try to upload a GIF to Facebook, a still image of the first
frame will appear. However, there are three ways to try and outsmart
the system.
Make a Youtube video look like a GIF.
Use a third party app on Facebook like Animated Picture. For this app, you do not use your own files. There are hundreds
sorted out in different categories to choose from.
Post a link to the GIF. Yes, the still image will show up, but a description will accompany it. Yes, it may take more time, but
your friends will be curious as to what it entails.
But, if the GIF you want to upload is not a moving picture, it should
work just fine. If you have a GIF image that is a nonmoving image, you
should have no problem uploading it to Facebook. According to the
Facebook Developers page, GIFs are one of many file types allowed for
uploading to the platform. Other supported image file types include
JPG, PNG, PSD, TIFF, JP2, IFF, WBMP and XBM images.
PS: This was the first result that I got when I googled about it. You'll find plenty of other sources for doing the same. For example: You Can Finally Put GIFs on Facebook.
if ([[UIApplication sharedApplication] canOpenURL: [NSURL URLWithString:#"facebook://app"]]){
NSLog(#"imag %#",_GIFURL);
self.documentationInteractionController.delegate = self;
self.documentationInteractionController.UTI = #"com.facebook.photo";
self.documentationInteractionController = [self setupControllerWithURL:_GIFURL usingDelegate:self];
[self.documentationInteractionController presentOpenInMenuFromRect:CGRectZero inView:self.view animated:YES];
}
else {
UIAlertView * alert = [[UIAlertView alloc] initWithTitle:#"facebook not installed." message:#"Your device has no facebook installed." delegate:self cancelButtonTitle:#"OK" otherButtonTitles:nil];
[alert show];
}
Use UIActivityItemProvider and extend - (id)item {} for Facebook:
Just upload the GIF to Giphy, then provide the Giphy URL to UIActivityViewController instead of the file contents, Facebook will recognize it and show the animated GIF
- (id)item
{
if ([self.activityType isEqualToString:UIActivityTypePostToFacebook]) {
// Upload to Giphy
...
return [NSURL URLWithString:giphyURL];
}
}
full code is in my GitHub, I am actually a iOS newb so some experts please correct me and the code if possible
I'm developing app for IPhones where users clicks button, gets the list of all videos from his IPhone and uploads chosen video to server.
I know how to upload video to server, but I don't know how to implement video searching.
How can I get pathes to all videos (in users IPhone) in Array?
(Currently my IPhone is unavailable for use, so I'd like to know also how to test video search in IPhone Simulator?)
Kind Regards
You need to use the UIImagePickerController component, configuring it to show only videos when browsing the library.
You can do that by setting the mediaTypes property of the picker in this way:
myImagePickerController.mediaTypes =
[[NSArray alloc] initWithObjects: (NSString *) kUTTypeMovie, nil];
Then if you want to test it in the simulator, you need to save some videos on it and you can use the UISaveVideoAtPathToSavedPhotosAlbum function to achieve that. Check out this great answer for more detailed instructions.
This link shows how to access only videos from the photoroll since all videos of the device should be stored there, you should be able to access them from there: Picking video from PhotoLibrary with UIImagePickerController in OS 3.1
NSURL *youTubeURL = [NSURL URLWithString:#"http://www.youtube.com/watch?v=HPwyVw_6vsQ&feature=youtu.be"]; // URL is a string which needs to be placed in #"" and close method call with ].
MPMoviePlayerController *player = [[MPMoviePlayerController alloc] initWithContentURL:youTubeURL];
imageSel = [player thumbnailImageAtTime:1.0 timeOption:MPMovieTimeOptionNearestKeyFrame];
I am using this code for getting thumbnail from the video and this return null value in the
imagesel.can anybody help me to solve this problem I am using YouTube URL .when I am using this code for the video that is in the main bundle then it is working fine.
Do this:
Firstly extract videoID from Video URL Link.
Now refer this link for getting thumbnail of video.
each youtube link has 4 thumbnail
http://img.youtube.com/vi/<insert-youtube-video-id-here>/0.jpg
http://img.youtube.com/vi/<insert-youtube-video-id-here>/1.jpg
http://img.youtube.com/vi/<insert-youtube-video-id-here>/2.jpg
http://img.youtube.com/vi/<insert-youtube-video-id-here>/3.jpg
this code is very good for
for example
i have this link:
http://www.youtube.com/watch?v=HPwyVw_6vsQ&feature=youtu.be
and the youtube video id is:
HPwyVw_6vsQ
and generated thumbnail from this link is:
http://img.youtube.com/vi/HPwyVw_6vsQ/1.jpg
this is very easy to use
if someone wants HQ image use this link
https://img.youtube.com/vi/<insert-youtube-video-id-here>/maxresdefault.jpg
If you have a YouTube watch page URL, and you want to get the thumbnail URL, the "correct" way to do that is to use oEmbed:
http://apiblog.youtube.com/2009/10/oembed-support.html
That way you don't have to attempt to parse the video id out of the URL.
But... what you really should be doing is using a iframe embed to display videos in your web page (or UIWebView). The YouTube API Terms of Service covers the supported ways of accessing YouTube content:
https://developers.google.com/youtube/terms
This application and this application says it displays live wallpapers on lock screen. We have similar requirement.
From reviews came to know that it is playing music in background with silent volume, but it is not relevant to setting wallpapers.
Totally bummer topic for us. Can anyone please suggest some point where to begin.. ?
Referred this and Referred this questions on our forum, but says that it won't be approved by Apple. So how does current application exist on store ?
Note:
Please consider this as genuine programming questions as there is no starting point we can find.
If you play music, you can use MPNowPlayingInfoCenter (Available in iOS 5.0 and later.) to set things like cover art, title and artist on the lock screen. Your code could look like this:
NSMutableDictionary *currentTrackData = [[NSMutableDictionary alloc] init];
[currentTrackData setObject:"Some text" forKey:MPMediaItemPropertyTitle];
MPMediaItemArtwork *mediaItemArtwork =[[MPMediaItemArtwork alloc] initWithImage:[UIImage imageNamed:#"your image path"]];
[currentTrackData setObject:mediaItemArtwork forKey:MPMediaItemPropertyArtwork];
[mediaItemArtwork release];
[MPNowPlayingInfoCenter defaultCenter].nowPlayingInfo = currentTrackData;
Dont forget to import the media player framework:
#import <MediaPlayer/MediaPlayer.h>
The live lockscreen app must be doing it this way (MPNowPlayingInfoCenter) as you cant play music whilst using the app
I am using MPMoviePlayerController to stream movie from the internet. And now my first application start to look nice :) BUT :) I have 4 URLs to stream (different movies), and I wan't when I tap to the movie to stop current movie and play another from another URL. Like changing channels on TV. I know how to catch tap, but I don't know how to change URL and start to play movie from that URL (like TV), any help?
I have used this tutorial to make application.
I think setContentURL is the function you're looking for. See:
Apple Documentation on MPMoviePlayerController
use [self.moviePlayer setContentURL:newUrl] to show the next video/movie. It is given in the Apple Documentation on MPMoviePlayerController. :)