嗨,我正在创建一个将进行直播的应用,其他用户可以查看
我目前正在使用Flash将其推入WOWZA,并且正在使用exoplayer对其进行查看
我使用RTMP是因为它是exoplayer支持的唯一具有低延迟的
一切正常,但是当我在现场静音麦克风时,exoplayer中的视频将冻结并进入状态
STATE_BUFFERING
,但不会继续进行STATE_READY
如果我取消静音,它将恢复正常并可以从
重新查看 STATE_BUFFERING
至STATE_READY
无论如何,我尝试在VLC中查看流,并且它确实可以正常工作
我尝试了其他解决方案,但不起作用
我的代码是这个
//initiate Player
//Create a default TrackSelector
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);
PlayerView playerView = findViewById(R.id.simple_player);
playerView.setPlayer(player);
RtmpDataSourceFactory rtmpDataSourceFactory = new RtmpDataSourceFactory();
// This is the MediaSource representing the media to be played.
MediaSource videoSource = new ExtractorMediaSource.Factory(rtmpDataSourceFactory)
.createMediaSource(Uri.parse(URL));
player.prepare(videoSource);
//auto start playing
player.setPlayWhenReady(true);
我希望有人能帮助我!
先谢谢您