-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add details YouTube view (#35)
* add keyword field in Video proto * add new page with youtube view * youtube id extractor, named parameters * Update minsdkversion
- Loading branch information
1 parent
76ac9e7
commit d1e26c0
Showing
14 changed files
with
322 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" | ||
#include "Generated.xcconfig" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" | ||
#include "Generated.xcconfig" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Uncomment this line to define a global platform for your project | ||
# platform :ios, '9.0' | ||
|
||
# CocoaPods analytics sends network stats synchronously affecting flutter build latency. | ||
ENV['COCOAPODS_DISABLE_STATS'] = 'true' | ||
|
||
project 'Runner', { | ||
'Debug' => :debug, | ||
'Profile' => :release, | ||
'Release' => :release, | ||
} | ||
|
||
def flutter_root | ||
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) | ||
unless File.exist?(generated_xcode_build_settings_path) | ||
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" | ||
end | ||
|
||
File.foreach(generated_xcode_build_settings_path) do |line| | ||
matches = line.match(/FLUTTER_ROOT\=(.*)/) | ||
return matches[1].strip if matches | ||
end | ||
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" | ||
end | ||
|
||
require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) | ||
|
||
flutter_ios_podfile_setup | ||
|
||
target 'Runner' do | ||
use_frameworks! | ||
use_modular_headers! | ||
|
||
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) | ||
end | ||
|
||
post_install do |installer| | ||
installer.pods_project.targets.each do |target| | ||
flutter_additional_ios_build_settings(target) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
PODS: | ||
- Flutter (1.0.0) | ||
- flutter_inappwebview (0.0.1): | ||
- Flutter | ||
- flutter_inappwebview/Core (= 0.0.1) | ||
- OrderedSet (~> 5.0) | ||
- flutter_inappwebview/Core (0.0.1): | ||
- Flutter | ||
- OrderedSet (~> 5.0) | ||
- OrderedSet (5.0.0) | ||
|
||
DEPENDENCIES: | ||
- Flutter (from `Flutter`) | ||
- flutter_inappwebview (from `.symlinks/plugins/flutter_inappwebview/ios`) | ||
|
||
SPEC REPOS: | ||
trunk: | ||
- OrderedSet | ||
|
||
EXTERNAL SOURCES: | ||
Flutter: | ||
:path: Flutter | ||
flutter_inappwebview: | ||
:path: ".symlinks/plugins/flutter_inappwebview/ios" | ||
|
||
SPEC CHECKSUMS: | ||
Flutter: 434fef37c0980e73bb6479ef766c45957d4b510c | ||
flutter_inappwebview: bfd58618f49dc62f2676de690fc6dcda1d6c3721 | ||
OrderedSet: aaeb196f7fef5a9edf55d89760da9176ad40b93c | ||
|
||
PODFILE CHECKSUM: aafe91acc616949ddb318b77800a7f51bffa2a4c | ||
|
||
COCOAPODS: 1.10.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:youtube_player_flutter/youtube_player_flutter.dart'; | ||
import 'package:pr12er/utils/extractor.dart'; | ||
|
||
class DetailApp extends StatelessWidget { | ||
late String url; | ||
|
||
DetailApp(String url) { | ||
this.url = Extractor.extractYoutubeId(url); | ||
} | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return MaterialApp( | ||
title: 'Welcome to Flutter', | ||
home: Scaffold( | ||
appBar: AppBar( | ||
automaticallyImplyLeading: true, | ||
leading: IconButton( | ||
icon: Icon(Icons.arrow_back), | ||
onPressed: () { | ||
Navigator.pop(context); | ||
}, | ||
), | ||
title: Text('Detail View'), | ||
), | ||
body: Detail(this.url)), | ||
); | ||
} | ||
} | ||
|
||
class Detail extends StatefulWidget { | ||
late String url; | ||
|
||
Detail(String url) { | ||
this.url = url; | ||
} | ||
@override | ||
_DetailState createState() => _DetailState(this.url); | ||
} | ||
|
||
class _DetailState extends State<Detail> { | ||
late String url; | ||
late YoutubePlayerController _controller; | ||
|
||
_DetailState(String url) { | ||
this.url = url; | ||
} | ||
|
||
@override | ||
void initState() { | ||
super.initState(); | ||
|
||
_controller = YoutubePlayerController( | ||
initialVideoId: this.url, | ||
flags: YoutubePlayerFlags( | ||
mute: false, | ||
autoPlay: true, | ||
), | ||
); | ||
} | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return YoutubePlayer( | ||
aspectRatio: 16 / 9, | ||
controller: _controller, | ||
showVideoProgressIndicator: false, | ||
progressIndicatorColor: Colors.redAccent, | ||
progressColors: ProgressBarColors( | ||
playedColor: Colors.transparent, | ||
handleColor: Colors.transparent, | ||
), | ||
onEnded: (data) { | ||
_controller.pause(); | ||
}, | ||
topActions: <Widget>[ | ||
const SizedBox(width: 8.0), | ||
Expanded( | ||
child: Text( | ||
_controller.metadata.title, | ||
style: const TextStyle( | ||
color: Colors.white, | ||
fontSize: 18.0, | ||
), | ||
overflow: TextOverflow.ellipsis, | ||
maxLines: 1, | ||
), | ||
), | ||
], | ||
bottomActions: <Widget>[ | ||
const SizedBox(width: 14.0), | ||
CurrentPosition(), | ||
const SizedBox(width: 8.0), | ||
ProgressBar( | ||
isExpanded: true, | ||
colors: ProgressBarColors( | ||
playedColor: Colors.red, | ||
handleColor: Colors.red, | ||
backgroundColor: Colors.white, | ||
bufferedColor: Colors.grey), | ||
), | ||
RemainingDuration(), | ||
], | ||
); | ||
} | ||
} |
Oops, something went wrong.