This repository has been archived by the owner on May 18, 2020. It is now read-only.
This repository has been archived by the owner on May 18, 2020. It is now read-only.
Video does not stops when we press back button #3
Closed
Description
import 'package:flutter/material.dart';
import 'package:youtube_player/youtube_player.dart';
class YTPlayer extends StatefulWidget {
final String videoID;
YTPlayer({this.videoID});
@OverRide
_YTPlayerState createState() => _YTPlayerState();
}
class _YTPlayerState extends State {
Widget youtubeplay() => YoutubePlayer(
source: widget.videoID,
quality: YoutubeQuality.HD,
aspectRatio: 16 / 9,
showThumbnail: true,
bufferedColor: Colors.grey,
playedColor: Colors.blue,
loop: false,
);
@OverRide
void dispose() {
super.dispose();
youtubeplay();
}
@OverRide
Widget build(BuildContext context) => Scaffold(
appBar: AppBar(
title: Text('Player'),
),
body: Container(
child: Column(
children: [
Card(
child: Center(
child: youtubeplay(),
),
)
],
),
),
);
}