关于电脑上如何查看直播:
- 首先确保你的电脑是否安装了Homebrew
man brew
- 如果没有安装,则在终端输入以下命令安装
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
- 第一步
brew tap homebrew/nginx
- 第二步
brew install nginx-full --with-rtmp-module
- 第三步,在终端输入
nginx
- 第四步,打开浏览器打开http://localhost:8080 如果出现以下所示,那么环境就搭建好了
- 第五步,在终端输入
brew info nginx-full
- 第六步,在终端 Command+F 搜索nginx.conf
- 第七步,进入该路径,以文本编辑形式打开配置文件,直接在最后面插入以下代码
rtmp {
server {
listen 1935;
application rtmplive {
live on;
record off;
}
}
}
demo
demo
- 第八步,查看nginx版本号,在终端输入:
nginx -v
demo
- 第九步,重启ngix,把版本号替换成你电脑的nginx的版本号
/usr/local/Cellar/nginx-full/1.10.1/bin/nginx -s reload
接下来就可以试下直播的效果了**
- 下载VLC客户端
- 打开项目代码,找到YPPhoneLiveViewController.m文件,将你电脑的ip替换到此处
- 运行项目,点击个人信息界面的我要直播,然后点击开始直播,然后打开VLC客户端,然后File->open network->输入:rtmp://(你的ip):1935/rtmplive/room
- 好了如果顺利了话。。。。 就可以测试一下直播了[]( ̄▽ ̄)*
项目展示
启动页
推荐界面
直播以及番剧界面
基于ijkplayer的播放器
写在最后
- 希望能把这个项目写完,还有许许多多的功能点没有写,持续更新中...
网友评论
The “Swift Language Version” (SWIFT_VERSION) build setting must be set to a supported value for targets which use Swift. This setting can be set in the build settings editor.
请问怎么处理?
https://github.com/daniulive/SmarterStreaming 可以看看这个
Choose “Convert” to update the source code in this project to Swift 3.
This action can be performed later using “Convert to Current Swift Syntax” in the Edit menu.
什么解决啊,哥们
哥们这个问题怎么解决啊?
类似这样的代码:public func analysis<Result>(ifSuccess: (T) -> Result, ifFailure: (Error) -> Result) -> Result {
switch self {
case let .Success(value):
return ifSuccess(value)
case let .Failure(value):
return ifFailure(value)
}
}
印象最深的是Realm,这三方我真是‘佩服’的五体投地,pod install的时间等得久还得开VPN,好不容易pod进来了build一下却搞出弄一堆配置问题,心累,放弃!
No profiles for 'com.michaelhuyp.Wuxianda' were found: Xcode couldn't find a provisioning profile matching 'com.michaelhuyp.Wuxianda'.
Code signing is required for product type 'Application' in SDK 'iOS 10.0'
真机调试不了错误,怎么搞
_sumTime += value / 60; 为啥要除以60呢?
cd /Users/cailufei/Desktop/Bilibili_Wuxianda-master
/bin/sh -c /Users/cailufei/Library/Developer/Xcode/DerivedData/Wuxianda-dfquzqomajbmvqhdmbrkhraljxag/Build/Intermediates/Wuxianda.build/Debug-iphoneos/Wuxianda.build/Script-46B01DEB02BBD02F355DD75C.sh
pod install后这样提示,还是没解决cocopods的问题,求大神指教
Unable to find a specification for `LFLiveKit
pod search LFLiveKit
[!] Unable to find a pod with name, author, summary, or descriptionmatching LFLiveKit
我的版本 xcode 7.2 pod 1.0.1 请问这个什么问题呢?
全部下载完成,就会有这个错误,感觉是LFLiveKit跟CPUImage里面的文件重复了,删掉GPUImage整个文件夹,项目可以编译,但无法安装。大神能解决一下这个问题吗?
输出界面显示 [YPPhoneLivePreview.m:275行] debugInfo uploadSpeed: 0 KB/s
我检查了下宿舍网络 发现没问题 但是还没查代码里面的原因 所以不知道问题出在哪里希望明天打打断点 查看代码 能得到些提示 好了 就这样 如果能的话希望大大抽个时间 一起探讨下 qq 568986318 郝仁
按照 上面的 提示将podfile 文件第一句改成source 'https://github.com/realm/realm-cocoa.git' 运行后还是出现这样的错误 请求帮助
AppledeMacBook-Pro:Bilibili_Wuxianda-master apple-$ pod install
Cloning spec repo `realm` from `https://github.com/realm/realm-cocoa.git`
Analyzing dependencies
[!] An unexpected version directory `ObjectStore` was encountered for the `/Users/apple-/.cocoapods/repos/realm/Realm` Pod in the `Realm` repository.
AppledeMacBook-Pro:Bilibili_Wuxianda-master apple-$
错误原因如下
AppledeMacBook-Pro:Bilibili_Wuxianda-master apple-$ pod repo update
Updating spec repo `master`
Updating spec repo `realm`
$ /usr/bin/git pull --ff-only
Already up-to-date.
AppledeMacBook-Pro:Bilibili_Wuxianda-master apple-$ pod install
Analyzing dependencies
[!] An unexpected version directory `ObjectStore` was encountered for the `/Users/apple-/.cocoapods/repos/realm/Realm` Pod in the `Realm` repository.
AppledeMacBook-Pro:Bilibili_Wuxianda-master apple-$
Installing MJRefresh (3.1.10)
Installing Masonry (1.0.1)
Installing ReactiveCocoa (4.1.0)
Installing Realm (1.0.1)
[!] Error installing Realm
[!] /usr/bin/git clone https://github.com/realm/realm-cocoa.git /var/folders/p5/ydj5kzgj60n0v5bprdmytbt40000gn/T/d20160804-19665-zi35oi --template= --single-branch --depth 1 --branch v1.0.1
Cloning into '/var/folders/p5/ydj5kzgj60n0v5bprdmytbt40000gn/T/d20160804-19665-zi35oi'...
error: RPC failed; result=56, HTTP code = 200
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed
git config --list
会输出:http.postbuffer=24288000
再次执行:pod setup
用这个可以解决
Installing ReactiveCocoa (4.1.0)
Installing Realm (1.0.1)
[!] Error installing Realm
想知道博主的B站数据从哪里获取的?
不过我解决这个问题后又有一个新的问题:'GPUImageContext.h' file not found。。。
明明已经把GPUImage pod下来了,还找不到文件....
Analyzing dependencies
Pre-downloading: `Realm` from `https://github.com/realm/realm-cocoa.git`
[!] Unable to find a specification for `UMengSocialCOM`
diff: /Manifest.lock: No such file or directory
error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.@MichaelHuyp