Skip to content

Commit

Permalink
feat: added vgv analysis, dart fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jhomlala committed Jun 15, 2024
1 parent 40e88b9 commit 02d1d83
Show file tree
Hide file tree
Showing 107 changed files with 3,036 additions and 2,711 deletions.
25 changes: 6 additions & 19 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,22 +1,9 @@
#include: package:lint/analysis_options_package.yaml

analyzer:
strong-mode:
implicit-dynamic: false

include: package:very_good_analysis/analysis_options.yaml
linter:
rules:
close_sinks: true
sort_constructors_first: false
avoid_classes_with_only_static_members: false
avoid_void_async: false
avoid_positional_boolean_parameters: false
avoid_function_literals_in_foreach_calls: false
prefer_constructors_over_static_methods: false
sort_unnamed_constructors_first: false
sized_box_for_whitespace: false
invalid_dependency: false
public_member_api_docs: false
flutter_style_todos: false
avoid_final_parameters: false
sort_pub_dependencies: false
avoid_unnecessary_containers: false
use_setters_to_change_properties: false

analyzer:
exclude: [build/**, lib/**.freezed.dart, lib/**.g.dart]
33 changes: 7 additions & 26 deletions example/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,28 +1,9 @@
# This file configures the analyzer, which statically analyzes Dart code to
# check for errors, warnings, and lints.
#
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
# invoked from the command line by running `flutter analyze`.

# The following line activates a set of recommended lints for Flutter apps,
# packages, and plugins designed to encourage good coding practices.
include: package:flutter_lints/flutter.yaml

include: package:very_good_analysis/analysis_options.yaml
linter:
# The lint rules applied to this project can be customized in the
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
# included above or to enable additional rules. A list of all available lints
# and their documentation is published at https://dart.dev/lints.
#
# Instead of disabling a lint rule for the entire project in the
# section below, it can also be suppressed for a single line of code
# or a specific dart file by using the `// ignore: name_of_lint` and
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
# producing the lint.
rules:
# avoid_print: false # Uncomment to disable the `avoid_print` rule
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule

# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options
public_member_api_docs: false
flutter_style_todos: false
avoid_final_parameters: false
sort_pub_dependencies: false
analyzer:
exclude: [build/**, lib/**.freezed.dart, lib/**.g.dart]
66 changes: 33 additions & 33 deletions example/lib/constants.dart
Original file line number Diff line number Diff line change
@@ -1,57 +1,57 @@
class Constants {
static const String bugBuckBunnyVideoUrl =
"https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4";
'https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4';
static const String forBiggerBlazesUrl =
"https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ForBiggerBlazes.mp4";
static const String fileTestVideoUrl = "testvideo.mp4";
static const String fileTestVideoEncryptUrl = "testvideo_encrypt.mp4";
'https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ForBiggerBlazes.mp4';
static const String fileTestVideoUrl = 'testvideo.mp4';
static const String fileTestVideoEncryptUrl = 'testvideo_encrypt.mp4';
static const String networkTestVideoEncryptUrl =
"https://github.com/tinusneethling/betterplayer/raw/ClearKeySupport/example/assets/testvideo_encrypt.mp4";
static const String fileExampleSubtitlesUrl = "example_subtitles.srt";
'https://github.com/tinusneethling/betterplayer/raw/ClearKeySupport/example/assets/testvideo_encrypt.mp4';
static const String fileExampleSubtitlesUrl = 'example_subtitles.srt';
static const String hlsTestStreamUrl =
"https://mtoczko.github.io/hls-test-streams/test-group/playlist.m3u8";
'https://mtoczko.github.io/hls-test-streams/test-group/playlist.m3u8';
static const String hlsPlaylistUrl =
"https://bitdash-a.akamaihd.net/content/sintel/hls/playlist.m3u8";
'https://bitdash-a.akamaihd.net/content/sintel/hls/playlist.m3u8';
static const Map<String, String> exampleResolutionsUrls = {
"LOW":
"https://file-examples-com.github.io/uploads/2017/04/file_example_MP4_480_1_5MG.mp4",
"MEDIUM":
"https://file-examples-com.github.io/uploads/2017/04/file_example_MP4_640_3MG.mp4",
"LARGE":
"https://file-examples-com.github.io/uploads/2017/04/file_example_MP4_1280_10MG.mp4",
"EXTRA_LARGE":
"https://file-examples-com.github.io/uploads/2017/04/file_example_MP4_1920_18MG.mp4"
'LOW':
'https://file-examples-com.github.io/uploads/2017/04/file_example_MP4_480_1_5MG.mp4',
'MEDIUM':
'https://file-examples-com.github.io/uploads/2017/04/file_example_MP4_640_3MG.mp4',
'LARGE':
'https://file-examples-com.github.io/uploads/2017/04/file_example_MP4_1280_10MG.mp4',
'EXTRA_LARGE':
'https://file-examples-com.github.io/uploads/2017/04/file_example_MP4_1920_18MG.mp4',
};
static const String phantomVideoUrl =
"http://sample.vodobox.com/skate_phantom_flex_4k/skate_phantom_flex_4k.m3u8";
'http://sample.vodobox.com/skate_phantom_flex_4k/skate_phantom_flex_4k.m3u8';
static const String elephantDreamVideoUrl =
"http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4";
'http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4';
static const String forBiggerJoyridesVideoUrl =
"http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ForBiggerJoyrides.mp4";
'http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ForBiggerJoyrides.mp4';
static const String verticalVideoUrl =
"http://www.exit109.com/~dnn/clips/RW20seconds_1.mp4";
static String logo = "logo.png";
'http://www.exit109.com/~dnn/clips/RW20seconds_1.mp4';
static String logo = 'logo.png';
static String placeholderUrl =
"https://imgix.bustle.com/uploads/image/2020/8/5/23905b9c-6b8c-47fa-bc0f-434de1d7e9bf-avengers-5.jpg";
'https://imgix.bustle.com/uploads/image/2020/8/5/23905b9c-6b8c-47fa-bc0f-434de1d7e9bf-avengers-5.jpg';
static String elephantDreamStreamUrl =
"http://cdn.theoplayer.com/video/elephants-dream/playlist.m3u8";
'http://cdn.theoplayer.com/video/elephants-dream/playlist.m3u8';
static String tokenEncodedHlsUrl =
"https://amssamples.streaming.mediaservices.windows.net/830584f8-f0c8-4e41-968b-6538b9380aa5/TearsOfSteelTeaser.ism/manifest(format=m3u8-aapl)";
'https://amssamples.streaming.mediaservices.windows.net/830584f8-f0c8-4e41-968b-6538b9380aa5/TearsOfSteelTeaser.ism/manifest(format=m3u8-aapl)';
static String tokenEncodedHlsToken =
"Bearer=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1cm46bWljcm9zb2Z0OmF6dXJlOm1lZGlhc2VydmljZXM6Y29udGVudGtleWlkZW50aWZpZXIiOiI5ZGRhMGJjYy01NmZiLTQxNDMtOWQzMi0zYWI5Y2M2ZWE4MGIiLCJpc3MiOiJodHRwOi8vdGVzdGFjcy5jb20vIiwiYXVkIjoidXJuOnRlc3QiLCJleHAiOjE3MTA4MDczODl9.lJXm5hmkp5ArRIAHqVJGefW2bcTzd91iZphoKDwa6w8";
'Bearer=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1cm46bWljcm9zb2Z0OmF6dXJlOm1lZGlhc2VydmljZXM6Y29udGVudGtleWlkZW50aWZpZXIiOiI5ZGRhMGJjYy01NmZiLTQxNDMtOWQzMi0zYWI5Y2M2ZWE4MGIiLCJpc3MiOiJodHRwOi8vdGVzdGFjcy5jb20vIiwiYXVkIjoidXJuOnRlc3QiLCJleHAiOjE3MTA4MDczODl9.lJXm5hmkp5ArRIAHqVJGefW2bcTzd91iZphoKDwa6w8';
static String widevineVideoUrl =
"https://storage.googleapis.com/wvmedia/cenc/h264/tears/tears_sd.mpd";
'https://storage.googleapis.com/wvmedia/cenc/h264/tears/tears_sd.mpd';
static String widevineLicenseUrl =
"https://proxy.uat.widevine.com/proxy?provider=widevine_test";
'https://proxy.uat.widevine.com/proxy?provider=widevine_test';
static String fairplayHlsUrl =
"https://fps.ezdrm.com/demo/hls/BigBuckBunny_320x180.m3u8";
'https://fps.ezdrm.com/demo/hls/BigBuckBunny_320x180.m3u8';
static String fairplayCertificateUrl =
"https://github.com/koldo92/betterplayer/raw/fairplay_ezdrm/example/assets/eleisure.cer";
static String fairplayLicenseUrl = "https://fps.ezdrm.com/api/licenses/";
'https://github.com/koldo92/betterplayer/raw/fairplay_ezdrm/example/assets/eleisure.cer';
static String fairplayLicenseUrl = 'https://fps.ezdrm.com/api/licenses/';
static String catImageUrl =
"https://img.webmd.com/dtmcms/live/webmd/consumer_assets/site_images/article_thumbnails/other/cat_relaxing_on_patio_other/1800x1200_cat_relaxing_on_patio_other.jpg";
'https://img.webmd.com/dtmcms/live/webmd/consumer_assets/site_images/article_thumbnails/other/cat_relaxing_on_patio_other/1800x1200_cat_relaxing_on_patio_other.jpg';
static String dashStreamUrl =
"https://bitmovin-a.akamaihd.net/content/sintel/sintel.mpd";
'https://bitmovin-a.akamaihd.net/content/sintel/sintel.mpd';
static String segmentedSubtitlesHlsUrl =
"https://eng-demo.cablecast.tv/segmented-captions/vod.m3u8";
'https://eng-demo.cablecast.tv/segmented-captions/vod.m3u8';
}
41 changes: 22 additions & 19 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,32 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_localizations/flutter_localizations.dart';

void main() => runApp(MyApp());
void main() => runApp(const MyApp());

class MyApp extends StatelessWidget {
const MyApp({super.key});

@override
Widget build(BuildContext context) {
return Shortcuts(
shortcuts: <LogicalKeySet, Intent>{
LogicalKeySet(LogicalKeyboardKey.select): const ActivateIntent(),
},
child: MaterialApp(
title: 'Better player demo',
localizationsDelegates: [
GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
],
supportedLocales: [
const Locale('en', 'US'),
const Locale('pl', 'PL'),
],
theme: ThemeData(
primarySwatch: Colors.green,
),
home: WelcomePage(),
));
shortcuts: <LogicalKeySet, Intent>{
LogicalKeySet(LogicalKeyboardKey.select): const ActivateIntent(),
},
child: MaterialApp(
title: 'Better player demo',
localizationsDelegates: const [
GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
],
supportedLocales: const [
Locale('en', 'US'),
Locale('pl', 'PL'),
],
theme: ThemeData(
primarySwatch: Colors.green,
),
home: const WelcomePage(),
),
);
}
}
3 changes: 1 addition & 2 deletions example/lib/model/video_list_data.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
class VideoListData {
VideoListData(this.videoTitle, this.videoUrl);
final String videoTitle;
final String videoUrl;
Duration? lastPosition;
bool? wasPlaying = false;

VideoListData(this.videoTitle, this.videoUrl);
}
46 changes: 26 additions & 20 deletions example/lib/pages/auto_fullscreen_orientation_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import 'package:example/constants.dart';
import 'package:flutter/material.dart';

class AutoFullscreenOrientationPage extends StatefulWidget {
const AutoFullscreenOrientationPage({super.key});

@override
_AutoFullscreenOrientationPageState createState() =>
_AutoFullscreenOrientationPageState();
Expand All @@ -14,13 +16,15 @@ class _AutoFullscreenOrientationPageState

@override
void initState() {
BetterPlayerConfiguration betterPlayerConfiguration =
BetterPlayerConfiguration(
aspectRatio: 16 / 9,
fit: BoxFit.contain,
autoDetectFullscreenDeviceOrientation: true);
BetterPlayerDataSource dataSource = BetterPlayerDataSource(
BetterPlayerDataSourceType.network, Constants.forBiggerBlazesUrl);
const betterPlayerConfiguration = BetterPlayerConfiguration(
aspectRatio: 16 / 9,
fit: BoxFit.contain,
autoDetectFullscreenDeviceOrientation: true,
);
final dataSource = BetterPlayerDataSource(
BetterPlayerDataSourceType.network,
Constants.forBiggerBlazesUrl,
);
_betterPlayerController = BetterPlayerController(betterPlayerConfiguration);
_betterPlayerController.setupDataSource(dataSource);
super.initState();
Expand All @@ -30,16 +34,16 @@ class _AutoFullscreenOrientationPageState
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("Auto full screen orientation"),
title: const Text('Auto full screen orientation'),
),
body: Column(
children: [
const SizedBox(height: 8),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
const Padding(
padding: EdgeInsets.symmetric(horizontal: 16),
child: Text(
"Aspect ratio and device orientation on full screen will be "
"managed by the BetterPlayer. Click on the fullscreen option.",
'Aspect ratio and device orientation on full screen will be '
'managed by the BetterPlayer. Click on the fullscreen option.',
style: TextStyle(fontSize: 16),
),
),
Expand All @@ -48,20 +52,22 @@ class _AutoFullscreenOrientationPageState
child: BetterPlayer(controller: _betterPlayerController),
),
ElevatedButton(
child: Text("Play horizontal video"),
child: const Text('Play horizontal video'),
onPressed: () {
BetterPlayerDataSource dataSource = BetterPlayerDataSource(
BetterPlayerDataSourceType.network,
Constants.forBiggerBlazesUrl);
final dataSource = BetterPlayerDataSource(
BetterPlayerDataSourceType.network,
Constants.forBiggerBlazesUrl,
);
_betterPlayerController.setupDataSource(dataSource);
},
),
ElevatedButton(
child: Text("Play vertical video"),
child: const Text('Play vertical video'),
onPressed: () async {
BetterPlayerDataSource dataSource = BetterPlayerDataSource(
BetterPlayerDataSourceType.network,
Constants.verticalVideoUrl);
final dataSource = BetterPlayerDataSource(
BetterPlayerDataSourceType.network,
Constants.verticalVideoUrl,
);
_betterPlayerController.setupDataSource(dataSource);
},
),
Expand Down
18 changes: 10 additions & 8 deletions example/lib/pages/basic_player_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import 'package:example/utils.dart';
import 'package:flutter/material.dart';

class BasicPlayerPage extends StatefulWidget {
const BasicPlayerPage({super.key});

@override
_BasicPlayerPageState createState() => _BasicPlayerPageState();
}
Expand All @@ -13,15 +15,15 @@ class _BasicPlayerPageState extends State<BasicPlayerPage> {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("Basic player"),
title: const Text('Basic player'),
),
body: Column(
children: [
const SizedBox(height: 8),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
const Padding(
padding: EdgeInsets.symmetric(horizontal: 16),
child: Text(
"Basic player created with the simplest factory method. Shows video from URL.",
'Basic player created with the simplest factory method. Shows video from URL.',
style: TextStyle(fontSize: 16),
),
),
Expand All @@ -31,10 +33,10 @@ class _BasicPlayerPageState extends State<BasicPlayerPage> {
Constants.forBiggerBlazesUrl,
),
),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
const Padding(
padding: EdgeInsets.symmetric(horizontal: 16),
child: Text(
"Next player shows video from file.",
'Next player shows video from file.',
style: TextStyle(fontSize: 16),
),
),
Expand All @@ -48,7 +50,7 @@ class _BasicPlayerPageState extends State<BasicPlayerPage> {
return const SizedBox();
}
},
)
),
],
),
);
Expand Down
Loading

0 comments on commit 02d1d83

Please sign in to comment.