[译] Android ExoPlayer Rtmp HLS DASH SmoothStreaming 其他
2017-11-16 21:36
2106 查看
https://medium.com/@KarthikPonnam/rtmp-player-android-using-exo-media-player-ac7a012b7a25
google exoplayer, 支持的格式蛮多的
https://github.com/google/exoplayer
DASH, SmoothStreaming, HLS, 其他
google exoplayer 开发文档
https://google.github.io/ExoPlayer/guide.html
但是不支持RTMP, 才有了下面的插件
github 源代码:
https://github.com/PonnamKarthik/RTMP-Exo-Player-Demo
使用Exo-Media Player的Rtmp Player Android
Hello Reader的,在我们开始之前
让我们看看什么是RTMP?
RTMP代表实时消息协议。它提供了音频,视频和数据从编码器到服务器的高性能传输,服务器通过互联网分发信号。许多流媒体提供商和编码器开发商都支持RTMP流媒体,包括Livestream。
在这里阅读有关rtmp的更多信息。
没有更多的理论让我们开始编码:-)
因为为了使用这个扩展-rtmp库,所需的最小sdk是15
编辑您的build.gradle文件并添加以下两个依赖项
然后同步你的项目
第3步:
现在在您的玩家活动中添加行来准备播放
运行你的代码,rtmp流将在你的应用程序中播放,大小约为2.5Mb
在这里下载项目。
如果您觉得这篇文章有用,请推荐并分享。
Android的RTMPExoplayer现场直播Android开发
附录:
【VLC-Android】vlc-android简例(14年的帖子)
http://www.cnblogs.com/over140/p/3932784.html
end
google exoplayer, 支持的格式蛮多的
https://github.com/google/exoplayer
DASH, SmoothStreaming, HLS, 其他
google exoplayer 开发文档
https://google.github.io/ExoPlayer/guide.html
但是不支持RTMP, 才有了下面的插件
github 源代码:
https://github.com/PonnamKarthik/RTMP-Exo-Player-Demo
使用Exo-Media Player的Rtmp Player Android
Hello Reader的,在我们开始之前
让我们看看什么是RTMP?
RTMP代表实时消息协议。它提供了音频,视频和数据从编码器到服务器的高性能传输,服务器通过互联网分发信号。许多流媒体提供商和编码器开发商都支持RTMP流媒体,包括Livestream。
在这里阅读有关rtmp的更多信息。
没有更多的理论让我们开始编码:-)
步骤1:
更改最低SDK版本defaultConfig { // ... minSdkVersion 15 // ... }
因为为了使用这个扩展-rtmp库,所需的最小sdk是15
编辑您的build.gradle文件并添加以下两个依赖项
compile 'com.google.android.exoplayer:exoplayer:r2.5.1' compile 'com.google.android.exoplayer:extension-rtmp:r2.5.1'
然后同步你的项目
第2步:
在布局文件中创建一个简单的exoplayer视图<com.google.android.exoplayer2.ui.SimpleExoPlayerView android:layout_width="match_parent" android:layout_height="match_parent" android:id="@+id/simple_player"> </com.google.android.exoplayer2.ui.SimpleExoPlayerView>
第3步:
现在在您的玩家活动中添加行来准备播放
//initiate Player //Create a default TrackSelector Handler mainHandler = new Handler(); BandwidthMeter bandwidthMeter = new DefaultBandwidthMeter(); TrackSelection.Factory videoTrackSelectionFactory = new AdaptiveTrackSelection.Factory(bandwidthMeter); TrackSelector trackSelector = new DefaultTrackSelector(videoTrackSelectionFactory); //Create the player SimpleExoPlayer player = ExoPlayerFactory.newSimpleInstance(this, trackSelector); SimpleExoPlayerView simpleExoPlayerView = (SimpleExoPlayerView) findViewById(R.id.simple_player); simpleExoPlayerView.setPlayer(player); RtmpDataSourceFactory rtmpDataSourceFactory = new RtmpDataSourceFactory(); // Produces Extractor instances for parsing the media data. ExtractorsFactory extractorsFactory = new DefaultExtractorsFactory(); // This is the MediaSource representing the media to be played. MediaSource videoSource = new ExtractorMediaSource(Uri.parse("rtmp://184.72.239.149/vod/mp4:bigbuckbunny_750.mp4"), rtmpDataSourceFactory, extractorsFactory, null, null); // Prepare the player with the source. player.prepare(videoSource);
运行你的代码,rtmp流将在你的应用程序中播放,大小约为2.5Mb
在这里下载项目。
如果您觉得这篇文章有用,请推荐并分享。
Android的RTMPExoplayer现场直播Android开发
附录:
【VLC-Android】vlc-android简例(14年的帖子)
http://www.cnblogs.com/over140/p/3932784.html
end
相关文章推荐
- 同时RTSP_RTMP_HTTP_HLS_视频文件播放的Android安卓全功能播放器EasyPlayerPro
- iOS开发之直播App流程介绍,直播资料收集汇总,视频推流,视频拉流,SMTP、RTMP、HLS、 PLPlayerKit
- iOS开发之直播App流程介绍,直播资料收集汇总,视频推流,视频拉流,SMTP、RTMP、HLS、 PLPlayerKit
- Android学习——利用ffmpeg+nginx+Ijkplayer在自己的电脑和手机上搭建rtmp直播上
- EasyPlayer Android基于ffmpeg实现播放(RTSP/RTMP/HTTP/HLS)同步录像功能
- EasyPlayerPro RTSP/RTMP/HLS/HTTP全功能流媒体播放器开发计划
- android 视频播放 Google exoplayer
- android exoplayer实现左右滑动屏幕快进快退
- Android API Guide for Media and Camera(三)—— 媒体与相机(ExoPlayer)
- Android基于HLS和RTMP协议的第三方SDK选择
- HLS/MPEG-DASH/RTMP with nginx
- EasyPlayerPro Windows流媒体播放器(RTSP/RTMP/HTTP/HLS/File/TCP/RTP/UDP都能播)发布啦
- iOS开发之直播App流程介绍,直播资料收集汇总,视频推流,视频拉流,SMTP、RTMP、HLS、 PLPlayerKit
- android之ExoPlayer探索
- [译][VLC] Android直播RTMP RTSP HLS(m3u8) MMS
- EasyPlayerPro Windows流媒体播放器(RTSP/RTMP/HTTP/HLS/File/TCP/RTP/UDP都能播)发布啦
- [译] 如何在Android中直播RTMP HLS
- 深入理解Android音视频同步机制(二)ExoPlayer的avsync逻辑
- PLDroidPlayer 是 Pili 直播 SDK 的安卓播放器。支持所有直播常用的格式,如:RTMP、HLS、FLV。拥有优秀的功能和特性,如:首屏秒开、追帧优化、丰富的数据和状态回调、硬解软解
- iOS开发之直播App流程介绍,直播资料收集汇总,视频推流,视频拉流,SMTP、RTMP、HLS、 PLPlayerKit