我想写一个小的iOS视频客户端,并且必须使用HTTP Live Streaming.视频来自支持HTTP直播流的Wowza媒体服务器,因此服务器端实现不是我的问题.我已经观看了WWDC视频,并阅读了有关HTTP直播的Apple文档.
但是没有人解释如何在iOS设备上播放视频.在WWDC中,有人提到有三个组织可以显示视频:
哪一个是最好的?
我如何从像这样的HTML页面中读出视频URL,这些是由服务器提供的?
<html>
<head>
<title>HTTP Live Streaming Example</title>
</head>
<body>
<video
src="http://devimages.apple.com/iphone/samples/bipbop/bipbopall.m3u8"
height="300" width="400"
>
</video>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
(来源:Apple HTTP直播流媒体概述)
我真的不知道从哪里开始编码......也许有人比烦人的"Stitched Stream Player"知道更好的示例代码,或者可以写一点教程......
我需要从AppDelegate设置一些UIViewController的UI元素.我使用了Storyboard,因此UIViewController不会在AppDelegate中初始化.
我尝试使用以下方法获取UIViewController的实例:
UIStoryboard* storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard_iPhone" bundle:[NSBundle mainBundle]];
TableViewController* myTableViewController = [storyboard instantiateViewControllerWithIdentifier:@"myTableViewController"];
Run Code Online (Sandbox Code Playgroud)
但是当我尝试设置一些UI元素,如UINavigationBar的UIBarButtonItem时,就像这里:
UIBarButtonItem* refreshButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemRefresh target:self action:@selector(refreshEntry)];
myTableViewController.navigationItem.rightBarButtonItem = refreshButton;
Run Code Online (Sandbox Code Playgroud)
UINavigationBar保持空白,UIBarButtonItem不出现......
如何更改UI?