-
Notifications
You must be signed in to change notification settings - Fork 3
33 feature add youtube view #35
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
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.