chewie icon indicating copy to clipboard operation
chewie copied to clipboard

Cannot change Source URL while in fullscreen ?

Open songguowei opened this issue 2 years ago • 1 comments

`import 'package:chewie/chewie.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:video_player/video_player.dart';

class ChewiePlayer extends StatefulWidget { final String? url; const ChewiePlayer({Key? key, this.url}) : super(key: key);

@override State<ChewiePlayer> createState() => _ChewiePlayerState(); }

class _ChewiePlayerState extends State<ChewiePlayer> { VideoPlayerController? videocontroller; ChewieController? chewieController;

@override void initState() { init(url: 'https://player.alicdn.com/video/aliyunmedia.mp4'); super.initState(); }

@override void dispose() { videocontroller?.dispose(); chewieController?.dispose(); super.dispose(); }

void init({String? url}) { videocontroller = VideoPlayerController.network(url!) ..initialize().then((_) { chewieController = ChewieController( videoPlayerController: videocontroller!, autoPlay: true, additionalOptions: (context) { return [ OptionItem( iconData: Icons.abc, title: 'next', onTap: () { init( url: 'https://player.alicdn.com/video/aliyunmedia.mp4'); }) ]; }, ); setState(() {}); }); }

@override Widget build(BuildContext context) { if (videocontroller!.value.isInitialized) { return Chewie(controller: chewieController!); } return const Center( child: CupertinoActivityIndicator( color: Colors.white, )); } } `

songguowei avatar Dec 31 '22 09:12 songguowei

@songguowei You got any solution for this?

JibuVarghese avatar Jun 27 '23 16:06 JibuVarghese