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

August/September changes #709

Merged
merged 38 commits into from
Sep 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
d179ab7
Added expandToFill parameter in BetterPlayerConfiguration
jhomlala Aug 22, 2021
7e99110
Updated changelog
jhomlala Aug 22, 2021
e44c3af
* Added `BetterPlayerControlsConfiguration.theme` factory for `Better…
jhomlala Aug 22, 2021
44acd92
Added null checks in seek commands in BetterPlayerControlsState.
jhomlala Aug 25, 2021
63ef709
Fixed issue with live stream where player controls were always visible.
jhomlala Aug 25, 2021
0337016
Updated tests
jhomlala Aug 26, 2021
4bf8f2a
Updated tests
jhomlala Aug 26, 2021
718e940
Updated tests
jhomlala Aug 29, 2021
1a28c84
Updated tests
jhomlala Aug 29, 2021
1e78931
Updated tests
jhomlala Aug 29, 2021
d783b36
Added tests to CI
jhomlala Aug 29, 2021
d6af2b3
Update ci.yml
jhomlala Aug 29, 2021
8236245
Updated tests
jhomlala Aug 29, 2021
8dac048
Updated tests
jhomlala Aug 29, 2021
f39fb09
Merge remote-tracking branch 'origin/feature/august_changes_2' into f…
jhomlala Aug 29, 2021
8d1edf2
Updated tests
jhomlala Aug 29, 2021
2efd4b6
Updated tests
jhomlala Aug 29, 2021
42c2270
Updated tests, general refactor
jhomlala Aug 29, 2021
6856204
Updated cupertino theme
jhomlala Aug 31, 2021
a0ec2db
Fixed iOS seek issue
jhomlala Sep 7, 2021
57a04e0
Fix iOS caching + add iOS feature: preCaching (#670)
Sep 7, 2021
7d92867
Added stop pre cache iOS implementation
jhomlala Sep 7, 2021
e68a09a
Updated caching implementation
jhomlala Sep 8, 2021
210d4d5
Updated caching implementation
jhomlala Sep 8, 2021
bfc8507
Updated caching implementation
jhomlala Sep 8, 2021
ed48d96
Updated caching implementation
jhomlala Sep 12, 2021
d486347
Updated documentation
jhomlala Sep 12, 2021
04f4530
Fixed video FPS hardcoded to 30 on iOs (#705)
antonkrasov Sep 15, 2021
b878227
Updated changelog
jhomlala Sep 15, 2021
55a9672
set default subtitle from hls (#688)
siloebb Sep 15, 2021
24db360
General refactor
jhomlala Sep 15, 2021
f23e8dd
Disabled analysis options.
jhomlala Sep 15, 2021
49248ee
Flutter 2.5 update
jhomlala Sep 16, 2021
ce341ec
Flutter 2.5 update
jhomlala Sep 16, 2021
ab597d5
Disabled lint
jhomlala Sep 16, 2021
d3e21ef
Fixed analyzer
jhomlala Sep 16, 2021
91b8d1c
Updated dependencies
jhomlala Sep 20, 2021
9da6c90
Updated version
jhomlala Sep 20, 2021
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
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