Skip to content
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

Replaced deprecated hashValues function with Object.hash in Flutter v… #1358

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,11 @@ build/
!**/ios/**/default.pbxuser
!**/ios/**/default.perspectivev3
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
example/pubspec.lock
pubspec.lock
example/ios/Flutter/Release.xcconfig
example/ios/Flutter/Debug.xcconfig
example/ios/Flutter/Debug.xcconfig
example/ios/Flutter/Debug.xcconfig
example/ios/Podfile
pubspec.lock
41 changes: 27 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,26 @@
<img src="https://raw.githubusercontent.com/jhomlala/betterplayer/master/media/logo.png">
</p>

# Better Player
[![pub package](https://img.shields.io/pub/v/better_player.svg)](https://pub.dartlang.org/packages/better_player)
# Better Player (Fixed Version)

[![pub package](https://img.shields.io/pub/v/better_player_fixed.svg)](https://pub.dartlang.org/packages/better_player_fixed)
[![pub package](https://img.shields.io/github/license/jhomlala/betterplayer.svg?style=flat)](https://github.com/jhomlala/betterplayer)
[![pub package](https://img.shields.io/badge/platform-flutter-blue.svg)](https://github.com/jhomlala/betterplayer)

Advanced video player. It solves many typical use cases and it's easy to run.
This is a **fixed version** of the original [Better Player](https://pub.dev/packages/better_player) package, created because the original developer is currently inactive. The package addresses issues such as deprecated Flutter functions and other maintenance updates.

## Original Author:

- [jhomlala](https://github.com/jhomlala)

## Changes:

- Replaced deprecated `hashValues` with `Object.hash` (Flutter 3.27.0).
- Maintained all original functionality.

This package is an enhancement of the original Better Player package, but all credits go to the original author for creating the base package.

Feel free to contribute if the original package becomes active again!

<table>
<tr>
Expand Down Expand Up @@ -67,7 +81,8 @@ Advanced video player. It solves many typical use cases and it's easy to run.
</table>

## Introduction
This plugin is based on [Chewie](https://github.com/brianegan/chewie). Chewie is awesome plugin and works well in many cases. Better Player is a continuation of ideas introduced in Chewie. Better player fix common bugs, adds more configuration options and solves typical use cases.

This plugin is based on [Chewie](https://github.com/brianegan/chewie). Chewie is awesome plugin and works well in many cases. Better Player is a continuation of ideas introduced in Chewie. Better player fix common bugs, adds more configuration options and solves typical use cases.

**Features:**
✔️ Fixed common bugs
Expand All @@ -80,23 +95,21 @@ This plugin is based on [Chewie](https://github.com/brianegan/chewie). Chewie is
✔️ BoxFit of video support
✔️ Playback speed support
✔️ HLS support (track, subtitles (also segmented), audio track selection)
✔️ DASH support (track, subtitles, audio track selection)
✔️ DASH support (track, subtitles, audio track selection)
✔️ Alternative resolution support
✔️ Cache support
✔️ Notifications support
✔️ Picture in Picture support
✔️ DRM support (token, Widevine, FairPlay EZDRM).
✔️ ... and much more!

✔️ Picture in Picture support
✔️ DRM support (token, Widevine, FairPlay EZDRM).
✔️ ... and much more!

## Documentation
* [Official documentation](https://jhomlala.github.io/betterplayer/)
* [Example application](https://github.com/jhomlala/betterplayer/tree/master/example)
* [API reference](https://pub.dev/documentation/better_player/latest/better_player/better_player-library.html)

- [Official documentation](https://jhomlala.github.io/betterplayer/)
- [Example application](https://github.com/jhomlala/betterplayer/tree/master/example)
- [API reference](https://pub.dev/documentation/better_player/latest/better_player/better_player-library.html)

## Important information

This plugin development is in progress. You may encounter breaking changes each version. This plugin is developed part-time for free. If you need
some feature which is supported by other players available in pub dev, then feel free to create PR. All valuable contributions are welcome!


18 changes: 10 additions & 8 deletions docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,21 @@ $ flutter pub get
3. Import it

```dart
import 'package:better_player/better_player.dart';
import 'package:better_player_enhanced/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.

5. (Required) Android configuration.
- Set deployment info of your project to **min. iOS 11.0 version**.
- Set Swift 5 version.

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.

- Set compileSdkVersion to _31_.
- Set kotlin version to _1.5.31_.
- Enable multidex.

6. (Optional) Additional iOS configuration

Expand Down
2 changes: 2 additions & 0 deletions example/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
*.swp
.DS_Store
.atom/
.build/
.buildlog/
.history
.svn/
.swiftpm/
migrate_working_dir/

# IntelliJ related
Expand Down
1 change: 1 addition & 0 deletions example/ios/Flutter/Debug.xcconfig
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"
1 change: 1 addition & 0 deletions example/ios/Flutter/Release.xcconfig
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"
2 changes: 1 addition & 1 deletion example/ios/Runner/AppDelegate.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Flutter
import UIKit

@UIApplicationMain
@main
@objc class AppDelegate: FlutterAppDelegate {
override func application(
_ application: UIApplication,
Expand Down
2 changes: 1 addition & 1 deletion example/lib/pages/auto_fullscreen_orientation_page.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'package:better_player/better_player.dart';
import 'package:better_player_enhanced/better_player.dart';
import 'package:example/constants.dart';
import 'package:flutter/material.dart';

Expand Down
2 changes: 1 addition & 1 deletion example/lib/pages/basic_player_page.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'package:better_player/better_player.dart';
import 'package:better_player_enhanced/better_player.dart';
import 'package:example/constants.dart';
import 'package:example/utils.dart';
import 'package:flutter/material.dart';
Expand Down
2 changes: 1 addition & 1 deletion example/lib/pages/cache_page.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'package:better_player/better_player.dart';
import 'package:better_player_enhanced/better_player.dart';
import 'package:example/constants.dart';
import 'package:flutter/material.dart';

Expand Down
2 changes: 1 addition & 1 deletion example/lib/pages/clearkey_page.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'dart:io';

import 'package:better_player/better_player.dart';
import 'package:better_player_enhanced/better_player.dart';
import 'package:flutter/material.dart';

import 'package:example/constants.dart';
Expand Down
2 changes: 1 addition & 1 deletion example/lib/pages/controller_controls_page.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'package:better_player/better_player.dart';
import 'package:better_player_enhanced/better_player.dart';
import 'package:example/constants.dart';
import 'package:flutter/material.dart';

Expand Down
2 changes: 1 addition & 1 deletion example/lib/pages/controls_always_visible_page.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'package:better_player/better_player.dart';
import 'package:better_player_enhanced/better_player.dart';
import 'package:example/constants.dart';
import 'package:flutter/material.dart';

Expand Down
2 changes: 1 addition & 1 deletion example/lib/pages/controls_configuration_page.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'package:better_player/better_player.dart';
import 'package:better_player_enhanced/better_player.dart';
import 'package:example/constants.dart';
import 'package:flutter/material.dart';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'package:better_player/better_player.dart';
import 'package:better_player_enhanced/better_player.dart';
import 'package:example/constants.dart';
import 'package:example/pages/custom_controls/custom_controls_widget.dart';
import 'package:flutter/material.dart';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'package:better_player/better_player.dart';
import 'package:better_player_enhanced/better_player.dart';
import 'package:flutter/material.dart';

class CustomControlsWidget extends StatefulWidget {
Expand Down
2 changes: 1 addition & 1 deletion example/lib/pages/dash_page.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'package:better_player/better_player.dart';
import 'package:better_player_enhanced/better_player.dart';
import 'package:example/constants.dart';
import 'package:flutter/material.dart';

Expand Down
2 changes: 1 addition & 1 deletion example/lib/pages/drm_page.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'package:better_player/better_player.dart';
import 'package:better_player_enhanced/better_player.dart';
import 'package:example/constants.dart';
import 'package:flutter/material.dart';

Expand Down
2 changes: 1 addition & 1 deletion example/lib/pages/event_listener_page.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'dart:async';

import 'package:better_player/better_player.dart';
import 'package:better_player_enhanced/better_player.dart';
import 'package:example/constants.dart';
import 'package:flutter/material.dart';

Expand Down
2 changes: 1 addition & 1 deletion example/lib/pages/fade_placeholder_page.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'dart:async';

import 'package:better_player/better_player.dart';
import 'package:better_player_enhanced/better_player.dart';
import 'package:example/constants.dart';
import 'package:flutter/material.dart';

Expand Down
2 changes: 1 addition & 1 deletion example/lib/pages/hls_audio_page.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'package:better_player/better_player.dart';
import 'package:better_player_enhanced/better_player.dart';
import 'package:example/constants.dart';
import 'package:flutter/material.dart';

Expand Down
2 changes: 1 addition & 1 deletion example/lib/pages/hls_subtitles_page.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'package:better_player/better_player.dart';
import 'package:better_player_enhanced/better_player.dart';
import 'package:example/constants.dart';
import 'package:flutter/material.dart';

Expand Down
2 changes: 1 addition & 1 deletion example/lib/pages/hls_tracks_page.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'package:better_player/better_player.dart';
import 'package:better_player_enhanced/better_player.dart';
import 'package:example/constants.dart';
import 'package:flutter/material.dart';

Expand Down
2 changes: 1 addition & 1 deletion example/lib/pages/memory_player_page.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'dart:io';

import 'package:better_player/better_player.dart';
import 'package:better_player_enhanced/better_player.dart';
import 'package:example/constants.dart';
import 'package:example/utils.dart';
import 'package:flutter/material.dart';
Expand Down
2 changes: 1 addition & 1 deletion example/lib/pages/normal_player_page.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'package:better_player/better_player.dart';
import 'package:better_player_enhanced/better_player.dart';
import 'package:example/constants.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
Expand Down
2 changes: 1 addition & 1 deletion example/lib/pages/notification_player_page.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'package:better_player/better_player.dart';
import 'package:better_player_enhanced/better_player.dart';
import 'package:example/constants.dart';
import 'package:flutter/material.dart';

Expand Down
2 changes: 1 addition & 1 deletion example/lib/pages/overridden_aspect_ratio_page.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'package:better_player/better_player.dart';
import 'package:better_player_enhanced/better_player.dart';
import 'package:example/constants.dart';
import 'package:flutter/material.dart';

Expand Down
2 changes: 1 addition & 1 deletion example/lib/pages/overriden_duration_page.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'package:better_player/better_player.dart';
import 'package:better_player_enhanced/better_player.dart';
import 'package:example/constants.dart';
import 'package:flutter/material.dart';

Expand Down
2 changes: 1 addition & 1 deletion example/lib/pages/picture_in_picture_page.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'package:better_player/better_player.dart';
import 'package:better_player_enhanced/better_player.dart';
import 'package:example/constants.dart';
import 'package:flutter/material.dart';

Expand Down
2 changes: 1 addition & 1 deletion example/lib/pages/placeholder_until_play_page.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'dart:async';

import 'package:better_player/better_player.dart';
import 'package:better_player_enhanced/better_player.dart';
import 'package:example/constants.dart';
import 'package:flutter/material.dart';

Expand Down
2 changes: 1 addition & 1 deletion example/lib/pages/playlist_page.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'package:better_player/better_player.dart';
import 'package:better_player_enhanced/better_player.dart';
import 'package:example/constants.dart';
import 'package:example/utils.dart';
import 'package:flutter/material.dart';
Expand Down
2 changes: 1 addition & 1 deletion example/lib/pages/resolutions_page.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'package:better_player/better_player.dart';
import 'package:better_player_enhanced/better_player.dart';
import 'package:example/constants.dart';
import 'package:flutter/material.dart';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'package:better_player/better_player.dart';
import 'package:better_player_enhanced/better_player.dart';
import 'package:collection/collection.dart' show IterableExtension;

class ReusableVideoListController {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'dart:async';

import 'package:better_player/better_player.dart';
import 'package:better_player_enhanced/better_player.dart';
import 'package:example/model/video_list_data.dart';
import 'package:example/pages/reusable_video_list/reusable_video_list_controller.dart';
import 'package:flutter/material.dart';
Expand Down
2 changes: 1 addition & 1 deletion example/lib/pages/rotation_and_fit_page.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'package:better_player/better_player.dart';
import 'package:better_player_enhanced/better_player.dart';
import 'package:example/constants.dart';
import 'package:flutter/material.dart';

Expand Down
2 changes: 1 addition & 1 deletion example/lib/pages/subtitles_page.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'package:better_player/better_player.dart';
import 'package:better_player_enhanced/better_player.dart';
import 'package:example/constants.dart';
import 'package:example/utils.dart';
import 'package:flutter/material.dart';
Expand Down
2 changes: 1 addition & 1 deletion example/lib/pages/video_list/video_list_widget.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'package:better_player/better_player.dart';
import 'package:better_player_enhanced/better_player.dart';
import 'package:example/model/video_list_data.dart';
import 'package:flutter/material.dart';

Expand Down
8 changes: 4 additions & 4 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: example
description: "Example to showcase use cases of Better Player."
publish_to: 'none'
publish_to: "none"
version: 1.0.0+1
environment:
sdk: '>=3.4.1 <4.0.0'
sdk: ">=3.4.1 <4.0.0"

dependencies:
better_player:
better_player_enhanced:
path: ../
flutter:
sdk: flutter
Expand All @@ -23,4 +23,4 @@ dev_dependencies:
flutter:
assets:
- assets/
uses-material-design: true
uses-material-design: true
2 changes: 1 addition & 1 deletion ios/Classes/BetterPlayer.m
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// found in the LICENSE file.

#import "BetterPlayer.h"
#import <better_player/better_player-Swift.h>
#import <better_player_enhanced/better_player_enhanced-Swift.h>

static void* timeRangeContext = &timeRangeContext;
static void* statusContext = &statusContext;
Expand Down
2 changes: 1 addition & 1 deletion ios/Classes/BetterPlayerPlugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// found in the LICENSE file.

#import "BetterPlayerPlugin.h"
#import <better_player/better_player-Swift.h>
#import <better_player_enhanced/better_player_enhanced-Swift.h>

#if !__has_feature(objc_arc)
#error Code Requires ARC.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html
#
Pod::Spec.new do |s|
s.name = 'better_player'
s.name = 'better_player_enhanced'
s.version = '0.0.1'
s.summary = 'A new flutter plugin project.'
s.description = <<-DESC
Expand Down
6 changes: 3 additions & 3 deletions lib/src/asms/better_player_asms_data_holder.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:better_player/src/asms/better_player_asms_audio_track.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_enhanced/src/asms/better_player_asms_audio_track.dart';
import 'package:better_player_enhanced/src/asms/better_player_asms_subtitle.dart';
import 'package:better_player_enhanced/src/asms/better_player_asms_track.dart';

class BetterPlayerAsmsDataHolder {
List<BetterPlayerAsmsTrack>? tracks;
Expand Down
2 changes: 1 addition & 1 deletion lib/src/asms/better_player_asms_subtitle.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'package:better_player/src/asms/better_player_asms_subtitle_segment.dart';
import 'package:better_player_enhanced/src/asms/better_player_asms_subtitle_segment.dart';

///Representation of HLS / DASH subtitle element.
class BetterPlayerAsmsSubtitle {
Expand Down
Loading