pod_player icon indicating copy to clipboard operation
pod_player copied to clipboard

pause is not working

Open 1041harpreet opened this issue 2 years ago • 9 comments

https://github.com/newtaDev/pod_player/assets/96649743/0bd7ae3f-81ac-452e-91e8-5f0229536a45

1041harpreet avatar Aug 22 '23 09:08 1041harpreet

Can you add reproducible steps

newtaDev avatar Aug 26 '23 07:08 newtaDev

class VideoPlayerControllerNotifier extends ChangeNotifier { PodPlayerController? _controller;

PodPlayerController? get controller => _controller;

String? videoValue;

setVideoValue(value) { videoValue = value; notifyListeners(); }

init(videourl) { if (_controller == null || videourl != videoValue) { _controller = PodPlayerController( playVideoFrom: PlayVideoFrom.youtube(videourl), podPlayerConfig: const PodPlayerConfig( autoPlay: true, isLooping: false, videoQualityPriority: [1080, 720, 360])) ..initialise().then((value) { _controller!.play(); setVideoValue(videourl); print(videoValue); }).onError((error, stackTrace) { print('error : $error'); }); } }

void stopPlay() { if (_controller != null) { _controller!.pause(); } } }

final videoProvider = ChangeNotifierProvider.autoDispose((ref) { return VideoPlayerControllerNotifier(); }); i am using this stopPlay() in my ui and this is used to control manyally but default video player stop function is also not working. my code for video player is ... in init state i am calling it like this void initState() {

WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
  ref.watch(videoProvider).init(widget.videourl);
}); }   and this is my video player 
                       PodVideoPlayer(
                        controller: ref.watch(videoProvider).controller!,
                      )

1041harpreet avatar Aug 26 '23 08:08 1041harpreet

@newtaDev please solve this issue, video pause is working after clicking pause button 2 3 times .

1041harpreet avatar Sep 01 '23 13:09 1041harpreet

Hi @1041harpreet, could you solve this? I have the same issue. Coincidence or not I'm also implementing a miniplayer like you

adoniasdantas avatar Dec 15 '23 11:12 adoniasdantas

@adoniasdantas hi, there were other errors while implementing pod player , so i used simple video player and chewie with mini player. for playling youtube videos you can use youtube explode pacakge,

1041harpreet avatar Dec 15 '23 12:12 1041harpreet

@1041harpreet Thanks for your comment Is it possible to send some sample on how you implemented your mini player like YouTube? i'm trying mini_player but it doesn't work for full screen either

adoniasdantas avatar Dec 15 '23 12:12 adoniasdantas

@adoniasdantas yes , i can share you mine code. message me in personal.

1041harpreet avatar Dec 15 '23 12:12 1041harpreet

As Github removed the private message feature, I've added you on LinkedIn

adoniasdantas avatar Dec 15 '23 12:12 adoniasdantas

How to solve it?@newtaDev

Purehi avatar Apr 20 '24 05:04 Purehi