English 中文(简体)
• 如何在桌前找到你管的嵌入视频,并在处理“Done”Button时把问题带进去
原标题:How to Get the youtube embedded video in tableview and getting the issue in handling "Done"Button

我怎么能把YouTube-video列入一个<编码>可调用的ViewCell,我如何处理<代码>。 Done -button of the UIWebView, 开放录像?

我把录像带入了一种观点,但就像图像一样。 并且我希望这一条码。 Done-button in this culture:

“Screenshot”/

我想在我再谈一下看法时,不要再开一个屏幕。

-(void)viewDidLoad {
    [super viewDidLoad];
    videoURL = [[NSString alloc]init];
    videoURL =@"http://www.youtube.com/watch?v=aE2b75FFZPI";
    [self embedYouTube:videoURL frame:CGRectMake(10, 85, 300, 180)];
}


- (void)embedYouTube:(NSString*)url frame:(CGRect)frame {  
    NSString* embedHTML = @" <html><head> <style type="text/css"> body { background-color: transparent; color: red; } </style> </head><body style="margin:0"> <embed id="yt" src="%@" type="application/x-shockwave-flash"  width="%0.0f" height="%0.0f"></embed> </body></html>";  
    NSString* html = [NSString stringWithFormat:embedHTML, url, frame.size.width, frame.size.height];  
    if (videoView == nil) {  
        videoView = [[UIWebView alloc] initWithFrame:frame];  
        [self.view addSubview:videoView];  
        NSLog(@"html%@",html);
    }  

    [videoView loadHTMLString:html baseURL:nil];  
}

在这方面,我需要一些帮助。 我进行了搜查,但我拿不出任何东西。

问题回答

既然这一点没有得到答复,我认为我可以提出建议。 我认为,最终结果与你所期望的相同,但通往那里的道路却没有什么不同。

因此,根据我的理解,你想要一名可读的电文控制员在你点击时展示一份YouTube视频清单。 在这方面,我是如何在我的一项申请中处理这一设想的。

  1. You need to get an RSS feed of videos you want in your list. That s pretty easy... if it s for a user the format is http://www.youtube.com/rss/user/{USERNAME}/videos.rss
  2. So from there you need to parse the RSS feed into a list of objects that have a title, description, thumbnail, and link to the video. All of this is provided in the RSS and I used NSXMLParser to do the work.
  3. Once you have a nice list of value objects to work with, all you need to do is have the table fire off a MPMoviePlayerViewController and pass it the URL to play the movie.

didSelectRowAtIndexPath Implementation

- (void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    /** self.items is just a mutable array of video objects that is the underlying 
        datasource for the table.  The Video object is just a simple value object 
        I created myself */
    Video *video = [self.items objectAtIndex:[indexPath row]];

    MPMoviePlayerViewController *mp = [[MPMoviePlayerViewController alloc] initWithContentURL:[NSURL URLWithString:video.video]];

    [self presentMoviePlayerViewControllerAnimated:mp];

    [mp release];
}

这里,我的视频班子的接口就象

@interface Video : NSManagedObject {

@property (nonatomic, retain) NSString * title;
@property (nonatomic, retain) NSString * link;
@property (nonatomic, retain) NSString * comments;
@property (nonatomic, retain) NSString * thumbnail;
@property (nonatomic, retain) NSString * pubDate;
@property (nonatomic, retain) NSString * video;
@property (nonatomic, retain) NSString * guid;
@property (nonatomic, retain) NSString * desc;

@end

这很简单,很容易在一架可调用的书记员播放YouTube录像。 我获得了XML教区,在那里有一席文件,说明如何做到这一点。 我只是迅速走了一步,这支博客实际上已进入我所说的话的nut子和bol子:

希望能让你们来。 我知道在网上打上标识的那点话,但我认为,你会这样看上去看上去做,因为没有很多答复......希望它能够接下去。

您所期待的是,与“网络网”使用的媒体角色进行沟通。 观点。 可以通过监测调查通知来做到这一点,然后通过一组次调查进行,但涉及使用私人方法,因此建议不特别因为私营媒体角色对每一条电线有变化。 我建议使用jerrylroberts回答,并与YouTube视频直接链接。





相关问题
Code sign Error

I have created a new iPhone application.I have two mach machines. I have created the certificate for running application in iPhone in one mac. Can I use the other mac for running the application in ...

ABPersonViewController Usage for displaying contact

Created a View based Project and added a contact to the AddressBook using ABAddressBookRef,ABRecordRef now i wanted to display the added contact ABPersonViewController is the method but how to use in ...

将音频Clips从Peter改为服务器

我不禁要问,那里是否有任何实例表明从Peit向服务器发送音响。 I m不关心电话或SIP风格的解决办法,只是一个简单的袖珍流程......

• 如何将搜查线重新定位?

我正试图把图像放在搜索条左边。 但是,问题始于这里,搜索条线不能重新布署。

热门标签