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

[BUG] Video is not playing but keep loading on Dialog widget. #1034

Open
1 task done
siamahnaf opened this issue Dec 10, 2024 · 0 comments
Open
1 task done

[BUG] Video is not playing but keep loading on Dialog widget. #1034

siamahnaf opened this issue Dec 10, 2024 · 0 comments
Assignees

Comments

@siamahnaf
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Package

youtube_player_flutter

What happened?

import 'package:flutter/material.dart';
import 'package:youtube_player_flutter/youtube_player_flutter.dart';

Future<void> showVideoDialog(BuildContext context, String videoUrl) {
  final videoId = YoutubePlayer.convertUrlToId(videoUrl);
  final YoutubePlayerController controller = YoutubePlayerController(
    initialVideoId: videoId!,
    flags: YoutubePlayerFlags(
      autoPlay: true,
      mute: false,
    ),
  );

  return showDialog(
    context: context,
    builder: (BuildContext context) {
      return Dialog(
        child: YoutubePlayer(
          controller: controller,
          showVideoProgressIndicator: false,
        ),
      );
    },
  );
}

What is the expected behaviour?

Video should play automatically when Dialog will be open. I am opening dialog with a button click and video url is dynamic coming from API.

How to reproduce?

Nothing

Flutter Doctor Output

No response

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