Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

动态更改加载视频地址 #62

Closed
cccchelly opened this issue Sep 27, 2019 · 4 comments
Closed

动态更改加载视频地址 #62

cccchelly opened this issue Sep 27, 2019 · 4 comments

Comments

@cccchelly
Copy link

你好,我想问一下怎么在一个界面动态更改视频地址呢?
我们的视频是有清晰度1和清晰度2两种,对应两个地址。功能要求可以动态切换。

目前代码:
url = url1;
player.setDataSource(url,autoPlay: true);

然后切换的时候:
setState(() {
url = url2;
});

这样操作会报错:
[ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: Bad state: setDataSource on invalid state FijkState.error
null

请问正确的实现方式是什么呢?

@befovy
Copy link
Owner

befovy commented Sep 27, 2019

hi, change to a different url during player is playing is not supported yet.
Smoothly switching requires changing the network layer related code.

@befovy
Copy link
Owner

befovy commented Nov 22, 2019

动态切换不同的清晰度需要在传输协议和封装上下功夫, 可以等 ijkplayer 2.0 版本。 其中 dash 支持无缝切换清晰度。
https://www.bilibili.com/read/cv3901523/
目前插件功能无法做到无缝切换,只能是关闭播放器,重新启动一个。

@befovy befovy closed this as completed Nov 22, 2019
@CaiJingLong
Copy link

动态切换不同的清晰度需要在传输协议和封装上下功夫, 可以等 ijkplayer 2.0 版本。 其中 dash 支持无缝切换清晰度。
https://www.bilibili.com/read/cv3901523/
目前插件功能无法做到无缝切换,只能是关闭播放器,重新启动一个。

2.0 厉害了 不知道会不会开源 或者什么时候开源

@befovy
Copy link
Owner

befovy commented Nov 22, 2019

不清楚呀,不认识 B站大神 @CaiJingLong

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants