Skip to content

Commit

Permalink
Feature/december 2021 changes (#854)
Browse files Browse the repository at this point in the history
* Updated dependencies

* Fix bug where a render error can occur if the width of the player is less than 240 pixels. (#810)

* Updated changelog

* Switch from jcenter to mavenCentral (#798)

* Updated changelog

* Fixed badState error (#796)

* Add dependencies on GCDWebServer and PINCache (#787)

Trying to fix part of #714

* Updated changelog

* Lint & format changes

* Updated installation documentation page

* Updated installation documentation page

* Updated installation documentation page

Co-authored-by: Alan <adman1108@gmail.com>
Co-authored-by: Peter Majchrak <pm@lix.com>
Co-authored-by: masoudk2000 <52602761+masoudk2000@users.noreply.github.com>
Co-authored-by: David Eriksson <david@activout.se>
  • Loading branch information
5 people authored Dec 29, 2021
1 parent fe7e10a commit 78f36d0
Show file tree
Hide file tree
Showing 24 changed files with 73 additions and 278 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
## 0.0.80
* Removed pedantic dependency.
* Updated dependencies.
* Fixed controls render issue for small player (by https://github.com/admarwick)
* Fixed deprecated jCenter. Replaced jCenter with mavenCentral (by https://github.com/petoknm)
* Fixed iOS GCDWebServer and PINCache import issue (by https://github.com/twogood)
* Added is mounted check in player controls (by https://github.com/masoudk2000)
* Updated installation documentation page.

## 0.0.79
* Fixed kotlin version issue.

Expand Down
6 changes: 2 additions & 4 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ buildscript {

repositories {
google()
jcenter()
mavenCentral()
}

dependencies {
Expand All @@ -24,7 +24,7 @@ buildscript {
rootProject.allprojects {
repositories {
google()
jcenter()
mavenCentral()
}
}

Expand Down Expand Up @@ -69,5 +69,3 @@ dependencies {
repositories {
mavenCentral()
}


15 changes: 11 additions & 4 deletions docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

```yaml
dependencies:
better_player: ^0.0.79
better_player: ^0.0.80
```
2. Install it
Expand All @@ -19,11 +19,18 @@ $ flutter pub get
import 'package:better_player/better_player.dart';
```

4. (Required) iOS configuration
4. (Required) iOS configuration
You need to change these settings in order to run Better Player on iOS:
* Set deployment info of your project to **min. iOS 11.0 version**.
* Set Swift 5 version.

Set deployment info of your project to **min. iOS 11.0 version**. This can be done in XCode in Runner -> General configuration screen.
5. (Required) Android configuration.
You need to change these settings in order to run Better Player on Android:
* Set compileSdkVersion to *31*.
* Set kotlin version to *1.5.31*.
* Enable multidex.

5. (Optional) Additional iOS configuration
6. (Optional) Additional iOS configuration

Add this into your `info.plist` file to support full screen rotation (Better Player will rotate screen to horizontal position when full screen is enabled):

Expand Down
4 changes: 2 additions & 2 deletions example/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ buildscript {
ext.multidexVersion = "2.0.1"
repositories {
google()
jcenter()
mavenCentral()
}

dependencies {
Expand All @@ -16,7 +16,7 @@ buildscript {
allprojects {
repositories {
google()
jcenter()
mavenCentral()
}
}

Expand Down
2 changes: 2 additions & 0 deletions ios/better_player.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ A new flutter plugin project.
s.public_header_files = 'Classes/**/*.h'
s.dependency 'Flutter'
s.dependency 'Cache', '~> 6.0.0'
s.dependency 'GCDWebServer'
s.dependency 'HLSCachingReverseProxyServer'
s.dependency 'PINCache'

s.platform = :ios, '11.0'
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'VALID_ARCHS[sdk=iphonesimulator*]' => 'x86_64' }
Expand Down
4 changes: 0 additions & 4 deletions lib/src/configuration/better_player_configuration.dart
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
import 'package:better_player/better_player.dart';
import 'package:better_player/src/configuration/better_player_translations.dart';
import 'package:better_player/src/subtitles/better_player_subtitles_configuration.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';

import 'better_player_event.dart';

///Configuration of Better Player. Allows to setup general behavior of player.
///Master configuration which contains children that configure specific part
///of player.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import 'dart:ui';
import 'package:better_player/better_player.dart';
import 'package:better_player/src/controls/better_player_overflow_menu_item.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

Expand Down
3 changes: 0 additions & 3 deletions lib/src/controls/better_player_controls_state.dart
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
import 'dart:io';
import 'dart:math';
import 'package:better_player/better_player.dart';
import 'package:better_player/src/asms/better_player_asms_audio_track.dart';
import 'package:better_player/src/asms/better_player_asms_track.dart';
import 'package:better_player/src/controls/better_player_clickable_widget.dart';
import 'package:better_player/src/core/better_player_utils.dart';
import 'package:better_player/src/video_player/video_player.dart';
import 'package:collection/collection.dart' show IterableExtension;
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
Expand Down
3 changes: 1 addition & 2 deletions lib/src/controls/better_player_cupertino_progress_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import 'package:better_player/src/core/better_player_controller.dart';
import 'package:better_player/src/video_player/video_player.dart';
import 'package:better_player/src/video_player/video_player_platform_interface.dart';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';

class BetterPlayerCupertinoVideoProgressBar extends StatefulWidget {
BetterPlayerCupertinoVideoProgressBar(
Expand Down Expand Up @@ -37,7 +36,7 @@ class _VideoProgressBarState
extends State<BetterPlayerCupertinoVideoProgressBar> {
_VideoProgressBarState() {
listener = () {
setState(() {});
if (mounted) setState(() {});
};
}

Expand Down
6 changes: 3 additions & 3 deletions lib/src/controls/better_player_material_controls.dart
Original file line number Diff line number Diff line change
Expand Up @@ -382,12 +382,12 @@ class _BetterPlayerMaterialControlsState
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
if (_controlsConfiguration.enableSkips)
_buildSkipButton()
Expanded(child: _buildSkipButton())
else
const SizedBox(),
_buildReplayButton(_controller!),
Expanded(child: _buildReplayButton(_controller!)),
if (_controlsConfiguration.enableSkips)
_buildForwardButton()
Expanded(child: _buildForwardButton())
else
const SizedBox(),
],
Expand Down
4 changes: 1 addition & 3 deletions lib/src/controls/better_player_material_progress_bar.dart
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import 'dart:async';
import 'package:better_player/better_player.dart';
import 'package:better_player/src/controls/better_player_progress_colors.dart';
import 'package:better_player/src/video_player/video_player.dart';
import 'package:better_player/src/video_player/video_player_platform_interface.dart';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';

class BetterPlayerMaterialVideoProgressBar extends StatefulWidget {
BetterPlayerMaterialVideoProgressBar(
Expand Down Expand Up @@ -37,7 +35,7 @@ class _VideoProgressBarState
extends State<BetterPlayerMaterialVideoProgressBar> {
_VideoProgressBarState() {
listener = () {
setState(() {});
if (mounted) setState(() {});
};
}

Expand Down
3 changes: 0 additions & 3 deletions lib/src/core/better_player.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,9 @@ import 'package:better_player/src/core/better_player_utils.dart';
import 'package:better_player/src/core/better_player_with_controls.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter/widgets.dart';
import 'package:visibility_detector/visibility_detector.dart';
import 'package:wakelock/wakelock.dart';

import 'better_player_controller_provider.dart';

///Widget which uses provided controller to render video player.
class BetterPlayer extends StatefulWidget {
const BetterPlayer({Key? key, required this.controller}) : super(key: key);
Expand Down
12 changes: 0 additions & 12 deletions lib/src/core/better_player_controller.dart
Original file line number Diff line number Diff line change
@@ -1,19 +1,7 @@
import 'dart:async';
import 'dart:io';
import 'package:better_player/better_player.dart';
import 'package:better_player/src/asms/better_player_asms_audio_track.dart';
import 'package:better_player/src/asms/better_player_asms_data_holder.dart';
import 'package:better_player/src/asms/better_player_asms_subtitle.dart';
import 'package:better_player/src/asms/better_player_asms_track.dart';
import 'package:better_player/src/asms/better_player_asms_utils.dart';
import 'package:better_player/src/configuration/better_player_configuration.dart';
import 'package:better_player/src/configuration/better_player_controller_event.dart';
import 'package:better_player/src/configuration/better_player_drm_type.dart';
import 'package:better_player/src/configuration/better_player_event.dart';
import 'package:better_player/src/configuration/better_player_event_type.dart';
import 'package:better_player/src/configuration/better_player_translations.dart';
import 'package:better_player/src/configuration/better_player_video_format.dart';
import 'package:better_player/src/core/better_player_controller_provider.dart';
import 'package:better_player/src/core/better_player_utils.dart';
import 'package:better_player/src/subtitles/better_player_subtitle.dart';
import 'package:better_player/src/subtitles/better_player_subtitles_factory.dart';
Expand Down
2 changes: 0 additions & 2 deletions lib/src/core/better_player_with_controls.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ import 'package:better_player/better_player.dart';
import 'package:better_player/src/configuration/better_player_controller_event.dart';
import 'package:better_player/src/controls/better_player_cupertino_controls.dart';
import 'package:better_player/src/controls/better_player_material_controls.dart';
import 'package:better_player/src/core/better_player_controller.dart';
import 'package:better_player/src/core/better_player_utils.dart';
import 'package:better_player/src/subtitles/better_player_subtitles_configuration.dart';
import 'package:better_player/src/subtitles/better_player_subtitles_drawer.dart';
import 'package:better_player/src/video_player/video_player.dart';
import 'package:flutter/material.dart';
Expand Down
3 changes: 0 additions & 3 deletions lib/src/list/better_player_list_video_player.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import 'package:better_player/better_player.dart';
import 'package:better_player/src/configuration/better_player_configuration.dart';
import 'package:better_player/src/configuration/better_player_data_source.dart';
import 'package:better_player/src/core/better_player_utils.dart';
import 'package:better_player/src/list/better_player_list_video_player_controller.dart';
import 'package:flutter/material.dart';

///Special version of Better Player which is used to play video in list view.
Expand Down
4 changes: 0 additions & 4 deletions lib/src/playlist/better_player_playlist.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import 'package:better_player/better_player.dart';
import 'package:better_player/src/configuration/better_player_configuration.dart';
import 'package:better_player/src/configuration/better_player_data_source.dart';
import 'package:better_player/src/core/better_player_utils.dart';
import 'package:better_player/src/playlist/better_player_playlist_configuration.dart';
import 'package:better_player/src/playlist/better_player_playlist_controller.dart';

// Flutter imports:
import 'package:flutter/material.dart';
Expand Down
3 changes: 0 additions & 3 deletions lib/src/playlist/better_player_playlist_controller.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import 'dart:async';

import 'package:better_player/better_player.dart';
import 'package:better_player/src/configuration/better_player_data_source.dart';
import 'package:better_player/src/core/better_player_controller.dart';

///Controller used to manage playlist player.
class BetterPlayerPlaylistController {
Expand Down
2 changes: 0 additions & 2 deletions lib/src/subtitles/better_player_subtitles_drawer.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import 'dart:async';
import 'package:better_player/better_player.dart';
import 'package:better_player/src/subtitles/better_player_subtitle.dart';
import 'package:better_player/src/subtitles/better_player_subtitles_configuration.dart';
import 'package:better_player/src/video_player/video_player.dart';
import 'package:flutter/material.dart';
import 'package:flutter_widget_from_html_core/flutter_widget_from_html_core.dart';

Expand Down
2 changes: 0 additions & 2 deletions lib/src/subtitles/better_player_subtitles_factory.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ import 'dart:convert';
import 'dart:io';
import 'package:better_player/better_player.dart';
import 'package:better_player/src/core/better_player_utils.dart';
import 'package:better_player/src/subtitles/better_player_subtitles_source.dart';
import 'better_player_subtitle.dart';
import 'better_player_subtitles_source_type.dart';

class BetterPlayerSubtitlesFactory {
static Future<List<BetterPlayerSubtitle>> parseSubtitles(
Expand Down
1 change: 0 additions & 1 deletion lib/src/video_player/method_channel_video_player.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:async';
import 'dart:ui';
import 'package:better_player/src/configuration/better_player_buffering_configuration.dart';
import 'package:better_player/src/core/better_player_utils.dart';
import 'package:flutter/foundation.dart';
Expand Down
3 changes: 0 additions & 3 deletions lib/src/video_player/video_player.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,8 @@ import 'dart:async';
import 'dart:io';
import 'package:better_player/src/configuration/better_player_buffering_configuration.dart';
import 'package:better_player/src/video_player/video_player_platform_interface.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:meta/meta.dart';
import 'package:pedantic/pedantic.dart';

final VideoPlayerPlatform _videoPlayerPlatform = VideoPlayerPlatform.instance
// This will clear all open videos on the platform when a full restart is
Expand Down
5 changes: 0 additions & 5 deletions lib/src/video_player/video_player_platform_interface.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,11 @@

// Dart imports:
import 'dart:async';
import 'dart:ui';

// Flutter imports:
import 'package:better_player/src/configuration/better_player_buffering_configuration.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/widgets.dart';

// Package imports:
import 'package:meta/meta.dart' show visibleForTesting;

import 'method_channel_video_player.dart';

/// The interface that implementations of video_player must implement.
Expand Down
Loading

0 comments on commit 78f36d0

Please sign in to comment.