2011-11-30 98 views
0

可能重複:
How can I do a search for video on youtube in my iPhone app?我可以在iPhone應用程序中搜索YouTube視頻嗎?

我寫從YouTube iPhone應用程序,搜索與視頻類(標籤),並播放它們。 我可以使它在應用程序中使用url播放YouTube視頻,但我不知道如何從YouTube上搜索視頻,並在我的iPhone應用程序中獲取視頻網址。

有沒有任何示例代碼或教程來做到這一點?

+0

http://stackoverflow.com/questions/5067354/how-can-i-do-a-search-for-video-on-youtube-in-my-iphone-app –

+0

謝謝你快速幫助。您能否提供GData API使用示例? – jinbruce627

回答

0

看起來確實有你如何能做到這一點的開始在網頁視圖:

- (void)viewDidLoad { 

    NSString *urlAddress = @"http://youtube.video.link.there"; 

    //Create a URL object. 
    NSURL *url = [NSURL URLWithString:urlAddress]; 

    //URL Requst Object 
    NSURLRequest *requestObj = [NSURLRequest requestWithURL:url]; 

    //Load the request in the UIWebView. 
    [youtubeWebView loadRequest:requestObj]; 

    //This is for stop bounce of the webView if you want 
    [[[youtubeWebView subviews] lastObject] setAlwaysBounceVertical:NO]; 

} 

您可以創建YouTube的一個小Web瀏覽器和網頁視圖加載結果,或者如果您在網頁視圖喜歡裏面不同的xib

相關問題