Skip to content

Commit

Permalink
August/September changes (#709)
Browse files Browse the repository at this point in the history
* Added expandToFill parameter in BetterPlayerConfiguration

* Updated changelog

* * Added `BetterPlayerControlsConfiguration.theme` factory for `BetterPlayerControlsConfiguration`.

* Added null checks in seek commands in BetterPlayerControlsState.

* Fixed issue with live stream where player controls were always visible.

* Updated tests

* Updated tests

* Updated tests

* Updated tests

* Updated tests

* Added tests to CI

* Update ci.yml

* Updated tests

* Updated tests

* Updated tests

* Updated tests

* Updated tests, general refactor

* Updated cupertino theme

* Fixed iOS seek issue

* Fix iOS caching + add iOS feature: preCaching (#670)

* Fix iOS caching + add iOS feature: preCaching

* Added required changes

* Fix compile issues

* Added stop pre cache iOS implementation

* Updated caching implementation

* Updated caching implementation

* Updated caching implementation

* Updated caching implementation

* Updated documentation

* Fixed video FPS hardcoded to 30 on iOs (#705)

Co-authored-by: Jakub <jhomlala@gmail.com>

* Updated changelog

* set default subtitle from hls (#688)

* set default subtitle from hls

* remove comments

* General refactor

* Disabled analysis options.

* Flutter 2.5 update

* Flutter 2.5 update

* Disabled lint

* Fixed analyzer

* Updated dependencies

* Updated version

Co-authored-by: themadmrj <themadmrj@users.noreply.github.com>
Co-authored-by: Anton Krasov <anton.krasov@gmail.com>
Co-authored-by: Siloe Bezerra Bispo <siloebb@gmail.com>
  • Loading branch information
4 people authored Sep 20, 2021
1 parent d8fb722 commit 3f1637f
Show file tree
Hide file tree
Showing 42 changed files with 1,642 additions and 568 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,15 @@ jobs:
working-directory: example
- name: Lint using flutter analyze
run: flutter analyze


test:
name: Test
runs-on: ubuntu-latest
container: cirrusci/flutter:stable

steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Test using flutter test
run: flutter test
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
## 0.0.74
* [BREAKING_CHANGE] `nextVideoTimeStreamController` is now marked as private. Please use `nextVideoTimeStream` to access stream.
* [BREAKING_CHANGE] Removed BackdropFilter from cupertino theme.
* [BREAKING_CHANGE] Removed `sigmaX` and `sigmaY` parameters from BetterPlayerControlsConfiguration.
* Added `expandToFill` in `BetterPlayerConfiguration`.
* Added `BetterPlayerControlsConfiguration.theme` factory for `BetterPlayerControlsConfiguration`.
* Added null checks in seek commands in `BetterPlayerControlsState`.
* Added tests.
* Added iOS HLS caching based on HLSCachingReverseProxyServer.
* Added default subtitle support for ASMS HLS data source (by https://github.com/siloebb).
* Fixed issue with live stream where player controls were always visible.
* Fixed iOS seek issue.
* Fixed getting started button link in documentation.
* Changed iOS non-HLS caching implementation based on https://github.com/neekeetab/CachingPlayerItem (by https://github.com/themadmrj).
* Fixed hardcoded 30 FPS on iOS (by https://github.com/antonkrasov).
* Enabled `preCache` and `stopPreCache` for iOS.
* Updated dependencies.

## 0.0.73
* Added `licenseUrl` support for iOS DRM.
* Fixed RTL text direction issue in player controls.
Expand Down
2 changes: 1 addition & 1 deletion docs/_coverpage.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
- Supports both Android and iOS

[GitHub](https://github.com/jhomlala/betterplayer)
[Get Started](#home)
[Get Started](#README)
17 changes: 15 additions & 2 deletions docs/cacheconfiguration.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,25 @@ Clear all cached data:
betterPlayerController.clearCache();
```

Start pre cache before playing video (android only):
Start pre cache before playing video:
```dart
betterPlayerController.preCache(_betterPlayerDataSource);
```

Stop running pre cache (android only):
Stop running pre cache:
```dart
betterPlayerController.stopPreCache(_betterPlayerDataSource);
```

On Android both HLS and non-HLS data sources will work in the same way (by using ExoPlayer internal cache mechanism). On iOS
for HLS stream [HLSCachingReverseProxyServer](https://github.com/StyleShare/HLSCachingReverseProxyServer) is being used,
and for other sources [CachingPlayerItem](https://github.com/neekeetab/CachingPlayerItem) is being used.

See table below to check which cache options are available on given platform:

| Feature | Android HLS | Android non-HLS | iOS HLS | iOS non-HLS |
|:-----------------:|:-----------:|:---------------:|:-------:|:-----------:|
| Normal item cache |||||
| Pre cache ||| x ||
| Stop cache ||| x ||

2 changes: 1 addition & 1 deletion 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.73
better_player: ^0.0.74
```
2. Install it
Expand Down
49 changes: 0 additions & 49 deletions example/ios/Podfile.lock

This file was deleted.

19 changes: 13 additions & 6 deletions example/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -264,18 +264,22 @@
);
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh",
"${BUILT_PRODUCTS_DIR}/CocoaAsyncSocket/CocoaAsyncSocket.framework",
"${BUILT_PRODUCTS_DIR}/KTVCocoaHTTPServer/KTVCocoaHTTPServer.framework",
"${BUILT_PRODUCTS_DIR}/KTVHTTPCache/KTVHTTPCache.framework",
"${BUILT_PRODUCTS_DIR}/Cache/Cache.framework",
"${BUILT_PRODUCTS_DIR}/GCDWebServer/GCDWebServer.framework",
"${BUILT_PRODUCTS_DIR}/HLSCachingReverseProxyServer/HLSCachingReverseProxyServer.framework",
"${BUILT_PRODUCTS_DIR}/PINCache/PINCache.framework",
"${BUILT_PRODUCTS_DIR}/PINOperation/PINOperation.framework",
"${BUILT_PRODUCTS_DIR}/better_player/better_player.framework",
"${BUILT_PRODUCTS_DIR}/path_provider/path_provider.framework",
"${BUILT_PRODUCTS_DIR}/wakelock/wakelock.framework",
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CocoaAsyncSocket.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/KTVCocoaHTTPServer.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/KTVHTTPCache.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Cache.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GCDWebServer.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/HLSCachingReverseProxyServer.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/PINCache.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/PINOperation.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/better_player.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/path_provider.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/wakelock.framework",
Expand Down Expand Up @@ -385,6 +389,7 @@
"$(PROJECT_DIR)/Flutter",
);
INFOPLIST_FILE = Runner/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
Expand Down Expand Up @@ -521,6 +526,7 @@
"$(PROJECT_DIR)/Flutter",
);
INFOPLIST_FILE = Runner/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
Expand Down Expand Up @@ -552,6 +558,7 @@
"$(PROJECT_DIR)/Flutter",
);
INFOPLIST_FILE = Runner/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
Expand Down
1 change: 0 additions & 1 deletion example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ class MyApp extends StatelessWidget {
],
theme: ThemeData(
primarySwatch: Colors.green,
accentColor: Colors.green,
),
home: WelcomePage(),
));
Expand Down
2 changes: 1 addition & 1 deletion example/lib/pages/cache_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class _CachePageState extends State<CachePage> {
);
_betterPlayerDataSource = BetterPlayerDataSource(
BetterPlayerDataSourceType.network,
Constants.elephantDreamVideoUrl,
Constants.phantomVideoUrl,
cacheConfiguration: BetterPlayerCacheConfiguration(
useCache: true,
preCacheSize: 10 * 1024 * 1024,
Expand Down
7 changes: 4 additions & 3 deletions ios/Classes/BetterPlayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@
#import <Flutter/Flutter.h>
#import <AVKit/AVKit.h>
#import <AVFoundation/AVFoundation.h>
#import <KTVHTTPCache/KTVHTTPCache.h>
#import <GLKit/GLKit.h>
#import "BetterPlayerTimeUtils.h"
#import "BetterPlayerView.h"
#import "BetterPlayerEzDrmAssetsLoaderDelegate.h"

NS_ASSUME_NONNULL_BEGIN

@class CacheManager;

@interface BetterPlayer : NSObject <FlutterPlatformView, FlutterStreamHandler, AVPictureInPictureControllerDelegate>
@property(readonly, nonatomic) AVPlayer* player;
@property(readonly, nonatomic) BetterPlayerEzDrmAssetsLoaderDelegate* loaderDelegate;
Expand Down Expand Up @@ -44,8 +45,8 @@ NS_ASSUME_NONNULL_BEGIN
- (instancetype)initWithFrame:(CGRect)frame;
- (void)setMixWithOthers:(bool)mixWithOthers;
- (void)seekTo:(int)location;
- (void)setDataSourceAsset:(NSString*)asset withKey:(NSString*)key withCertificateUrl:(NSString*)certificateUrl withLicenseUrl:(NSString*)licenseUrl overriddenDuration:(int) overriddenDuration;
- (void)setDataSourceURL:(NSURL*)url withKey:(NSString*)key withCertificateUrl:(NSString*)certificateUrl withLicenseUrl:(NSString*)licenseUrl withHeaders:(NSDictionary*)headers withCache:(BOOL)useCache overriddenDuration:(int) overriddenDuration;
- (void)setDataSourceAsset:(NSString*)asset withKey:(NSString*)key withCertificateUrl:(NSString*)certificateUrl withLicenseUrl:(NSString*)licenseUrl cacheKey:(NSString*)cacheKey cacheManager:(CacheManager*)cacheManager overriddenDuration:(int) overriddenDuration;
- (void)setDataSourceURL:(NSURL*)url withKey:(NSString*)key withCertificateUrl:(NSString*)certificateUrl withLicenseUrl:(NSString*)licenseUrl withHeaders:(NSDictionary*)headers withCache:(BOOL)useCache cacheKey:(NSString*)cacheKey cacheManager:(CacheManager*)cacheManager overriddenDuration:(int) overriddenDuration;
- (void)setVolume:(double)volume;
- (void)setSpeed:(double)speed result:(FlutterResult)result;
- (void) setAudioTrack:(NSString*) name index:(int) index;
Expand Down
Loading

0 comments on commit 3f1637f

Please sign in to comment.