Update README.md

This commit is contained in:
夏楚 2019-08-20 09:54:23 +08:00 committed by GitHub
parent 1fcb0f6284
commit 63caabf4f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -237,7 +237,7 @@ It is recommended to compile on Ubuntu or MacOScompiling on windows is cumber
## Usage ## Usage
- As server - As server
``` ```cpp
TcpServer::Ptr rtspSrv(new TcpServer()); TcpServer::Ptr rtspSrv(new TcpServer());
TcpServer::Ptr rtmpSrv(new TcpServer()); TcpServer::Ptr rtmpSrv(new TcpServer());
TcpServer::Ptr httpSrv(new TcpServer()); TcpServer::Ptr httpSrv(new TcpServer());
@ -250,7 +250,7 @@ It is recommended to compile on Ubuntu or MacOScompiling on windows is cumber
``` ```
- As player - As player
``` ```cpp
MediaPlayer::Ptr player(new MediaPlayer()); MediaPlayer::Ptr player(new MediaPlayer());
weak_ptr<MediaPlayer> weakPlayer = player; weak_ptr<MediaPlayer> weakPlayer = player;
player->setOnPlayResult([weakPlayer](const SockException &ex) { player->setOnPlayResult([weakPlayer](const SockException &ex) {
@ -279,7 +279,7 @@ It is recommended to compile on Ubuntu or MacOScompiling on windows is cumber
player->play("rtsp://admin:jzan123456@192.168.0.122/"); player->play("rtsp://admin:jzan123456@192.168.0.122/");
``` ```
- As proxy server - As proxy server
``` ```cpp
//support rtmp and rtsp url //support rtmp and rtsp url
//just support H264+AAC //just support H264+AAC
auto urlList = {"rtmp://live.hkstv.hk.lxdns.com/live/hks", auto urlList = {"rtmp://live.hkstv.hk.lxdns.com/live/hks",
@ -294,7 +294,7 @@ It is recommended to compile on Ubuntu or MacOScompiling on windows is cumber
``` ```
- As puser - As puser
``` ```cpp
PlayerProxy::Ptr player(new PlayerProxy("app","stream")); PlayerProxy::Ptr player(new PlayerProxy("app","stream"));
player->play("rtmp://live.hkstv.hk.lxdns.com/live/hks"); player->play("rtmp://live.hkstv.hk.lxdns.com/live/hks");