pod_player icon indicating copy to clipboard operation
pod_player copied to clipboard

Only 360p available in live YouTube videos.

Open Aryan20apr opened this issue 2 years ago • 1 comments

While playing recorded videos from YouTube, I am able to select from 360p, 480p and 720p. But in live video from YouTube, only 360p is available. Here is my code-

 class PodYouTubePlayerScreen extends StatefulWidget {
  const PodYouTubePlayerScreen({super.key, required this.video});
  final Videos video;
  @override
  PodYouTubePlayerScreenState createState() => PodYouTubePlayerScreenState();
}

class PodYouTubePlayerScreenState extends State<PodYouTubePlayerScreen> {

  late final PodPlayerController controller;
  @override
  void initState() {

     controller = PodPlayerController(
    playVideoFrom: PlayVideoFrom.youtube(widget.video.link!,live: widget.video.isLive??false,videoPlayerOptions: VideoPlayerOptions()),
    podPlayerConfig: const PodPlayerConfig(
      autoPlay: true,
      isLooping: false,
      videoQualityPriority: [1080,720, 480,360]
    ),
    
  )..initialise();

    super.initState();

  }

  @override
  Widget build(BuildContext context) {
    return SafeArea(

      child: Scaffold(

            appBar: AppBar(
              title: Text('${widget.video.title}'),
            ),
            body:Column(mainAxisAlignment: MainAxisAlignment.spaceBetween,children: [
              //  _videoLink.isNotEmpty
              // ? SizedBox(
              //   width: MediaQuery.of(context).size.width,

              //   child:

           PodVideoPlayer(controller: controller),

            if(widget.video.isLive!=null && widget.video.isLive!)
              Expanded(child: Padding(
                padding: const EdgeInsets.only(top:4.0),
                child: ChatView(video: widget.video,),
              ))
            ])
          )

      );

  }

  @override
  void dispose() {
    controller.dispose();
    super.dispose();
  }
}

Aryan20apr avatar Dec 05 '23 07:12 Aryan20apr

The quality of YouTube videos are provided by youtube_explode_dart https://pub.dev/packages/youtube_explode_dart package that we are using to extract videos Its not controlled by us

newtaDev avatar Dec 07 '23 03:12 newtaDev