Skip to content

Commit

Permalink
General bugfixes, 0.0.42
Browse files Browse the repository at this point in the history
  • Loading branch information
jhomlala committed Dec 30, 2020
1 parent bd94979 commit 5257f03
Show file tree
Hide file tree
Showing 9 changed files with 39 additions and 14 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
## 0.0.42
* Fixed resolution issue
* Fixed type of BetterPlayerDataSource for file type
* Added audio notify on dispose (iOS) (fixed by https://github.com/kingiol)

## 0.0.41
* Fixed loadingColor and loadingWidget for cupertino player
* Increased size of cupertino buttons
* Fixed setControlsEnabled in cupertino/material player
* [BREAKING_CHANGE] Removed startAt, looping, placeholder, overlay, fullScreenByDefault,
allowedScreenSleep, systemOverlaysAfterFullScreen, deviceOrientationsAfterFullScreen from BetterPlayerController


## 0.0.40
* Exposed VideoPlayerValue in export
* Fixed log issue
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ This plugin is based on [Chewie](https://github.com/brianegan/chewie). Chewie is

```yaml
dependencies:
better_player: ^0.0.41
better_player: ^0.0.42
```
2. Install it
Expand Down
6 changes: 3 additions & 3 deletions example/lib/pages/basic_player_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ class _BasicPlayerPageState extends State<BasicPlayerPage> {
),
),
AspectRatio(
aspectRatio: 16 / 9,
child: BetterPlayer.network(Constants.bugBuckBunnyVideoUrl),
),
aspectRatio: 16 / 9,
child: BetterPlayer.network(
'https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ForBiggerBlazes.mp4')),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
child: Text(
Expand Down
4 changes: 3 additions & 1 deletion example/lib/pages/normal_player_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ class _NormalPlayerPageState extends State<NormalPlayerPage> {
fit: BoxFit.contain,
);
BetterPlayerDataSource dataSource = BetterPlayerDataSource(
BetterPlayerDataSourceType.network, Constants.elephantDreamVideoUrl);
BetterPlayerDataSourceType.network,
Constants.forBiggerBlazesUrl,
);
_betterPlayerController = BetterPlayerController(betterPlayerConfiguration);
_betterPlayerController.setupDataSource(dataSource);
super.initState();
Expand Down
1 change: 1 addition & 0 deletions ios/Classes/FLTBetterPlayerPlugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -886,6 +886,7 @@ - (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult)result {
[player dispose];
}
});
[[AVAudioSession sharedInstance] setActive:NO withOptions:AVAudioSessionSetActiveOptionNotifyOthersOnDeactivation error:nil];
result(nil);
} else if ([@"setLooping" isEqualToString:call.method]) {
[player setIsLooping:[argsMap[@"looping"] boolValue]];
Expand Down
2 changes: 1 addition & 1 deletion lib/src/configuration/better_player_data_source.dart
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ class BetterPlayerDataSource {
BetterPlayerNotificationConfiguration notificationConfiguration,
}) {
return BetterPlayerDataSource(
BetterPlayerDataSourceType.network,
BetterPlayerDataSourceType.file,
url,
subtitles: subtitles,
useHlsSubtitles: useHlsSubtitles,
Expand Down
22 changes: 20 additions & 2 deletions lib/src/video_player/method_channel_video_player.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import 'dart:async';
import 'dart:ui';

// Flutter imports:
import 'package:better_player/src/core/better_player_utils.dart';
import 'package:flutter/services.dart';
import 'package:flutter/widgets.dart';

Expand Down Expand Up @@ -195,12 +196,29 @@ class MethodChannelVideoPlayer extends VideoPlayerPlatform {
final String key = map["key"] as String;
switch (eventType) {
case 'initialized':
double width = 0;
double height = 0;

try {
if (map.containsKey("width")) {
num widthNum = map["width"];
width = widthNum.toDouble();
}
if (map.containsKey("height")) {
num heightNum = map["height"];
height = heightNum.toDouble();
}
} catch (exception) {
BetterPlayerUtils.log(exception);
}

Size size = Size(width, height);

return VideoEvent(
eventType: VideoEventType.initialized,
key: key,
duration: Duration(milliseconds: map['duration'] as int),
size: Size((map['width'] as int)?.toDouble() ?? 0.0,
(map['height'] as int)?.toDouble() ?? 0.0),
size: size,
);
case 'completed':
return VideoEvent(
Expand Down
8 changes: 4 additions & 4 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,14 @@ packages:
name: flutter_widget_from_html_core
url: "https://pub.dartlang.org"
source: hosted
version: "0.5.0+5"
version: "0.5.1+4"
html:
dependency: transitive
description:
name: html
url: "https://pub.dartlang.org"
source: hosted
version: "0.14.0+3"
version: "0.14.0+4"
import_js_library:
dependency: transitive
description:
Expand Down Expand Up @@ -232,7 +232,7 @@ packages:
name: quiver
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.3"
version: "2.1.5"
sky_engine:
dependency: transitive
description: flutter
Expand Down Expand Up @@ -328,7 +328,7 @@ packages:
name: win32
url: "https://pub.dartlang.org"
source: hosted
version: "1.7.3"
version: "1.7.4"
xdg_directories:
dependency: transitive
description:
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: better_player
description: Advanced video player based on video_player and Chewie. It's solves many typical use cases and it's easy to run.
version: 0.0.41
version: 0.0.42
authors:
- Jakub Homlala <[email protected]>
homepage: https://github.com/jhomlala/betterplayer
Expand Down

0 comments on commit 5257f03

Please sign in to comment.