想住得离AWS / FMS流iPhone(使用HLS) [英] trying to live stream from AWS/FMS to iphone (using HLS)

查看:283
本文介绍了想住得离AWS / FMS流iPhone(使用HLS)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经设置了运行Flash媒体服务器(FMS),这是现场直播的HTTP流媒体(HLS)继<一在亚马逊AWS实例href="http://docs.amazonwebservices.com/AmazonCloudFront/latest/DeveloperGuide/FMS4.5EmbeddingLiveStream.html"相对=nofollow>这些说明,所以我知道我使用的流格式的iPhone的权利冒着热气。

I've set up an instance on Amazon AWS running Flash Media Server (FMS), which is broadcasting Live HTTP Streaming (HLS) following these instructions, so I know I'm steaming using the right streaming format for iPhone.

此外,使用我已经证实,该服务器已启动并运行,我已经成功地建立了一个Flash客户端读取其HDS流相同的指令(HTTP动态流的闪存器件)。

Further, using the same instructions i've confirmed that the server is up and running and i've successfully set up a flash client to read its HDS stream (HTTP Dynamic Stream for flash devices).

我写了这个iPhone客户端code播放流(从教程这使得它与本地视频文件的工作..这工作对我来说太):

I wrote this iphone client code to play the stream (stolen from a tutorial that makes it work with a local video file.. that worked for me too):

@implementation BigBuckBunnyViewController

-(IBAction)playMovie:(id)sender
{
    NSURL *streamURL = [NSURL URLWithString:@"http://dstvrton8xbej.cloudfront.net/hls-live/livepkgr/_definst_/liveevent/livestream.m3u8"];
    MPMoviePlayerController *moviePlayerContoller = [[MPMoviePlayerController alloc] initWithContentURL:streamURL];

    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(moviePlaybackComplete) name:MPMoviePlayerPlaybackDidFinishNotification object:moviePlayerContoller];

    [self.view addSubview:moviePlayerContoller.view];
    moviePlayerContoller.fullscreen = YES;
    [moviePlayerContoller play];

}

- (void)moviePlaybackComplete: (NSNotification *)notification
{
    MPMoviePlayerController *moviePlayerController = [notification object];
    [[NSNotificationCenter defaultCenter] removeObserver:self name:MPMoviePlayerPlaybackDidFinishNotification
                                                  object:moviePlayerController];

    [moviePlayerController.view removeFromSuperview];
    [moviePlayerController release];

}

但我得到这个错误味精当我编译code到我的iPad:

but i get this error msg when i compile the code onto my ipad:

2012-07-13 17:45:20.513 BigBuckBunny[3714:607] -[BigBuckBunnyViewController moviePlaybackComplete]: unrecognized selector sent to instance 0x21050080
2012-07-13 17:45:20.524 BigBuckBunny[3714:607] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[BigBuckBunnyViewController moviePlaybackComplete]: unrecognized selector sent to instance 0x21050080'        

从Mac <一个href="http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Miscellaneous/Foundation_Constants/Reference/reference.html#//apple_ref/doc/c_ref/NSInvalidArgumentException"相对=nofollow>文档 <当你传递的参数无效的方法,例如在一个非空的对象,需要一个零指针EM> NSInvalidArgumentException 的发生。任何人的想法?

from Mac documentation NSInvalidArgumentException happens when you pass an invalid argument to a method, such as a nil pointer where a non-nil object is required. Any ideas folks?

推荐答案

解决方法很简单。基本上这是一个语法错误(笑)......加上':'moviePlaybackComplete后

The solution is simple.. basically it's a syntax error (lol).. add ':' after moviePlaybackComplete

[[NSNotificationCenter defaultCenter] addObserver:self 
                                         selector:@selector(moviePlaybackComplete:) 
                                             name:MPMoviePlayerPlaybackDidFinishNotification   
                                           object:moviePlayerContoller];

这篇关于想住得离AWS / FMS流iPhone(使用HLS)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆