Skip to content
This repository has been archived by the owner on Aug 24, 2021. It is now read-only.

Commit

Permalink
video run
Browse files Browse the repository at this point in the history
  • Loading branch information
gamer-1478 committed Jun 22, 2021
1 parent 8db109f commit d19c01f
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 1 deletion.
1 change: 1 addition & 0 deletions android/settings_aar.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include ':app'
22 changes: 21 additions & 1 deletion lib/screens/monument.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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._();
Expand Down Expand Up @@ -117,6 +117,17 @@ class _MonumentContentState extends State<MonumentContent> {
}

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(
Expand Down Expand Up @@ -313,6 +324,14 @@ class _MonumentContentState extends State<MonumentContent> {
height: 5.0,
),

//video
YoutubePlayer(
controller: _controller,
liveUIColor: Colors.amber),
SizedBox(
height: 5.0,
),

Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Expand All @@ -339,6 +358,7 @@ class _MonumentContentState extends State<MonumentContent> {
indent: 40.0,
color: Colors.black,
),

// play quiz button
MaterialButton(
splashColor: Colors.white,
Expand Down
21 changes: 21 additions & 0 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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"
1 change: 1 addition & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit d19c01f

Please sign in to comment.