diff --git a/android/settings_aar.gradle b/android/settings_aar.gradle new file mode 100644 index 0000000..e7b4def --- /dev/null +++ b/android/settings_aar.gradle @@ -0,0 +1 @@ +include ':app' diff --git a/lib/screens/monument.dart b/lib/screens/monument.dart index a857975..978198f 100644 --- a/lib/screens/monument.dart +++ b/lib/screens/monument.dart @@ -10,8 +10,8 @@ import 'package:latlong/latlong.dart'; import "package:flutter_tts/flutter_tts.dart"; import 'package:http/http.dart' as http; import 'package:cached_network_image/cached_network_image.dart'; -//import 'package:shared_preferences/shared_preferences.dart'; import 'package:url_launcher/url_launcher.dart'; +import 'package:youtube_player_flutter/youtube_player_flutter.dart'; class MapUtils { MapUtils._(); @@ -117,6 +117,17 @@ class _MonumentContentState extends State { } final result = json.decode(snapshot.data); + String videoId = result["ytUrl"].toString(); + YoutubePlayerController _controller = YoutubePlayerController( + initialVideoId: videoId, + flags: YoutubePlayerFlags( + autoPlay: false, + mute: false, + isLive: false, + loop: false, + disableDragSeek: false, + forceHD: false), + ); return Scaffold( body: Container( @@ -313,6 +324,14 @@ class _MonumentContentState extends State { height: 5.0, ), + //video + YoutubePlayer( + controller: _controller, + liveUIColor: Colors.amber), + SizedBox( + height: 5.0, + ), + Row( mainAxisAlignment: MainAxisAlignment.center, children: [ @@ -339,6 +358,7 @@ class _MonumentContentState extends State { indent: 40.0, color: Colors.black, ), + // play quiz button MaterialButton( splashColor: Colors.white, diff --git a/pubspec.lock b/pubspec.lock index 9aa42bf..b9607b2 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -216,6 +216,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "3.0.0" + flutter_inappwebview: + dependency: transitive + description: + name: flutter_inappwebview + url: "https://pub.dartlang.org" + source: hosted + version: "4.0.0+4" flutter_map: dependency: "direct main" description: @@ -359,6 +366,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.0.1" + mime: + dependency: transitive + description: + name: mime + url: "https://pub.dartlang.org" + source: hosted + version: "0.9.7" nested: dependency: transitive description: @@ -721,6 +735,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "4.5.1" + youtube_player_flutter: + dependency: "direct main" + description: + name: youtube_player_flutter + url: "https://pub.dartlang.org" + source: hosted + version: "7.0.0+7" sdks: dart: ">=2.12.0-0.0 <3.0.0" flutter: ">=1.22.2" diff --git a/pubspec.yaml b/pubspec.yaml index 6a7766f..14cc417 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -43,6 +43,7 @@ dependencies: # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. cupertino_icons: ^1.0.0 + youtube_player_flutter: ^7.0.0+7 dev_dependencies: flutter_test: