如何从网址播放现场直播的摄像机 [英] how to play live streaming from url for a camera that broadcasting live

查看:99
本文介绍了如何从网址播放现场直播的摄像机的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试播放来自服务器的直播视频,例如opentok或wowza媒体服务器。如何实现请分享您的知识..

I am trying to play a live stream video from server, like opentok or wowza media server. how to implement please share your knowledge..



Ip摄像机录制视频并将其发送到服务器和服务器广播它,这是接收和玩iphone

An Ip camera record video and send it to server and server broadcast it and this is to receive and play in iphone



推荐答案

您可以使用MPMovieplayerviewcontroller。它非常适合流式传输音频/视频。我也是

You can use MPMovieplayerviewcontroller. It is perfect for streaming audio/video. I am also

在我的App& amp;它看起来像是iPhone的默认播放器。

use this for streaming audio in one of my App & also it looks like default player of iPhone.

这里是编码使用这个播放器,就像我在我的项目中所做的那样:

Ok here is coding for use of this player as I am doing in my project:

    NSString *geturl = [[radiotablearray objectAtIndex:btntag]objectForKey:@"iurl"];
    NSLog(@"geturl..%@",geturl);
    NSURL *fileURL=[NSURL URLWithString:geturl];
    NSLog(@"fileURL..%@",fileURL);
    moviePlayerController = [[MPMoviePlayerViewController alloc] initWithContentURL:fileURL];
    [moviePlayerController.moviePlayer prepareToPlay];
    moviePlayerController.moviePlayer.shouldAutoplay=YES;
    moviePlayerController.view.frame = self.view.frame;
    [self presentMoviePlayerViewControllerAnimated:moviePlayerController];
[moviePlayerController.moviePlayer play];

同时添加mediaplayer& App.And中的Avfoundation框架在.h文件中添加或导入这两个:

Also add mediaplayer & Avfoundation framework in App.And add or import these two in .h file:

#import <MediaPlayer/MediaPlayer.h>
#import <AVFoundation/AVFoundation.h>

&在.m文件中导入 #import< MediaPlayer / MediaPlayer.h> 。还可以在.h文件中制作如下所示的播放器的属性:

& import #import <MediaPlayer/MediaPlayer.h>this in .m file. also make property of player like below in .h file:

MPMoviePlayerViewController *moviePlayerController;
 @property(strong,retain)  MPMoviePlayerViewController *moviePlayerController;

并根据需要添加方法,但也可根据需要更改代码我只是发送给您我的工具代码你只需要根据你的要求进行更改。祝你好运。

And add method where you want but also make changes in code according to your need I am just send you my implement code you just change it with your requirement. Best of luck.

这篇关于如何从网址播放现场直播的摄像机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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