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

有全局的播放控制么 #43

Closed
lancao008 opened this issue Sep 3, 2019 · 3 comments
Closed

有全局的播放控制么 #43

lancao008 opened this issue Sep 3, 2019 · 3 comments
Assignees

Comments

@lancao008
Copy link

比如播放当前视频可以设置停止其他所有播放

@befovy
Copy link
Owner

befovy commented Sep 3, 2019

比如播放当前视频可以设置停止其他所有播放

fijkplayer 中目前没有这个功能,谢谢关注

@befovy befovy self-assigned this Sep 4, 2019
@befovy
Copy link
Owner

befovy commented Sep 4, 2019

develop 分支已经增加全部播放器支持。

用法参考单元测试

    test("allInstance", () async {
      FijkPlayer player1 = FijkPlayer();
      FijkPlayer player2 = FijkPlayer();

      expect(FijkPlayer.all.length, 0);

      expect(player1, isNotNull);
      expect(player2, isNotNull);
      int id1 = await player1.id;
      expect(id1, player1.idSync);
      int id2 = await player2.id;
      expect(id2, player2.idSync);

      expect(id1 != id2, true);
      expect(FijkPlayer.all.length, 2);

      await player1.release();
      expect(FijkPlayer.all.length, 1);
      await player2.release();
      expect(FijkPlayer.all.length, 0);
    });
      FijkPlayer.all.where((p) => p.idSync != id1).forEach((p) async{
            //  do what you want.
            // for example, pause all player expect player1
      });

@befovy
Copy link
Owner

befovy commented Sep 4, 2019

此更新发布在 0.1.3 版本中

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

2 participants