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

[notwork in fullscreen] auto play next src #266

Closed
shiyiya opened this issue Feb 4, 2020 · 12 comments
Closed

[notwork in fullscreen] auto play next src #266

shiyiya opened this issue Feb 4, 2020 · 12 comments

Comments

@shiyiya
Copy link
Contributor

shiyiya commented Feb 4, 2020

initPlayer() async {
   
    _videoPlayerController = VideoPlayerController.network(src);
    _videoPlayerController.addListener(autoNextLis);

    _chewieController = ChewieController(
      videoPlayerController: _videoPlayerController,
      aspectRatio: 16 / 9,
      autoPlay: true,
      looping: false,
      allowedScreenSleep: false,
      allowFullScreen: true,
      allowMuting: false,
    );
    setState(() {});
  }

 autoNextLis() {
    int total = _videoPlayerController.value.duration?.inMilliseconds;
    final int pos = _videoPlayerController.value.position?.inMilliseconds ?? 0;

    if (total == null) total = 1;
    if (total - pos <= 0) {
      _videoPlayerController.removeListener(autoNextLis);
      if (currPlayIndex + 1 < videoList.length) toggleVideo(currPlayIndex + 1);
    }
  }

 toggleVideo(int i) async {
    if (i == currPlayIndex ||
        i > videoList.length - 1 ||
        (!_videoPlayerController.value.initialized &&
            !_videoPlayerController.value.hasError)) return;
    await _videoPlayerController.pause();
    currPlayIndex = i;
    await initPlayer();
  }

When the playback is finished, the next video is played, and the full-screen video is stopped, but the non-full-screen video is playing the next video (click back to see)!

@peak77
Copy link

peak77 commented Mar 19, 2021

@shiyiya 你好,全屏播放的时候,上一个播放完,自动播放下一个,你实现了吗

@shiyiya
Copy link
Contributor Author

shiyiya commented Mar 19, 2021

@shiyiya 你好,全屏播放的时候,上一个播放完,自动播放下一个,你实现了吗

你可以看我 fork 的那份 找跳转全屏(全屏播放)那个代码文件的提交记录,原项目的判断似乎有点问题 我改了一下就好了

@peak77
Copy link

peak77 commented Mar 19, 2021

@shiyiya 你好,全屏播放的时候,上一个播放完,自动播放下一个,你实现了吗

你可以看我 fork 的那份 找跳转全屏(全屏播放)那个代码文件的提交记录,原项目的判断似乎有点问题 我改了一下就好了
好的 非常谢谢 我去看下~

@peak77
Copy link

peak77 commented Mar 19, 2021

@shiyiya 你好,全屏播放的时候,上一个播放完,自动播放下一个,你实现了吗

你可以看我 fork 的那份 找跳转全屏(全屏播放)那个代码文件的提交记录,原项目的判断似乎有点问题 我改了一下就好了

hello,我看提交那里没找到你提交的这个? 方便留个联系方式吗

@nstrelow
Copy link
Collaborator

Could you write english please?
or use emojis.

Just something, most people understand.

@shiyiya
Copy link
Contributor Author

shiyiya commented Mar 21, 2021

There is something wrong with the judgment here . ( I'm not sure, but I got the effect I wanted after the change)
↓ ↓ ↓
here

@peak77
Copy link

peak77 commented Mar 22, 2021

There is something wrong with the judgment here . ( I'm not sure, but I got the effect I wanted after the change)
↓ ↓ ↓
here

ok,thank you.

1 similar comment
@peak77
Copy link

peak77 commented Mar 22, 2021

There is something wrong with the judgment here . ( I'm not sure, but I got the effect I wanted after the change)
↓ ↓ ↓
here

ok,thank you.

@zoozobib
Copy link

zoozobib commented Sep 13, 2021

There is something wrong with the judgment here . ( I'm not sure, but I got the effect I wanted after the change)
↓ ↓ ↓
here

ok,thank you.

请问您解决了吗?具体是怎么修改的?@peakerWu 谢谢

@zoozobib
Copy link

zoozobib commented Sep 13, 2021

There is something wrong with the judgment here . ( I'm not sure, but I got the effect I wanted after the change)
↓ ↓ ↓
here

您好,求教您是如何修改的?我这边也出现了这个问题 @shiyiya

shiyiya added a commit to shiyiya/chewie that referenced this issue Sep 19, 2021
@zoozobib
Copy link

@shiyiya 感谢你的回复和支持!!!

@zoozobib
Copy link

zoozobib commented Sep 19, 2021 via email

@shiyiya shiyiya closed this as completed Oct 3, 2021
Ahmadre added a commit that referenced this issue Nov 25, 2021
codenameakshay pushed a commit to qoohoo-app/chewie that referenced this issue Aug 29, 2022
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

4 participants