Player_Flutter icon indicating copy to clipboard operation
Player_Flutter copied to clipboard

预加载,有概率有声音无画面。

Open YougaKing opened this issue 1 year ago • 1 comments

// 播放视频 A: 如果将 autoPlay 设置为 true, 那么 startVodPlay 调用会立刻开始视频的加载和播放 String urlA = "http://1252463788.vod2.myqcloud.com/xxxxx/v.f10.mp4"; controller.setAutoPlay(isAutoPlay: true); controller.startVodPlay(urlA);

// 在播放视频 A 的同时,预加载视频 B,做法是将 setAutoPlay 设置为 false String urlB = "http://1252463788.vod2.myqcloud.com/xxxxx/v.f20.mp4"; controller.setAutoPlay(isAutoPlay: false); controller.startVodPlay(urlB); // 不会立刻开始播放,而只会开始加载视频

controller.onPlayerEventBroadcast.listen((event) async {//订阅状态变化 if(event["event"] == TXVodPlayEvent.PLAY_EVT_PLAY_END) { await _controller_A.stop(); await _controller_B.resume(); } });

播放器A播放完成后,await _controller_B.resume(); 播放器B 有概率出现有声音无画面的情况,此时,刷新刷新页面也不会出现画面,

完整代码

YougaKing avatar Dec 08 '23 09:12 YougaKing

@YougaKing 有声音没有画面,播放器应该没有链接到flutter端的纹理,可以检查下组件TXPlayerVideo中的_textureId是否与预加载视频播放器传入的纹理textureId一致

Kongdy avatar Mar 05 '24 06:03 Kongdy

长时间未回复,关闭 issue

Kongdy avatar Jul 26 '24 06:07 Kongdy