Skip to content

Commit 1cfb5af

Browse files
authored
[video_player_avplay] Support multi TizenOS version (#896)
1 parent aae2068 commit 1cfb5af

File tree

4 files changed

+50
-14
lines changed

4 files changed

+50
-14
lines changed

packages/video_player_avplay/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## 0.6.0
2+
* Support multi TizenOS version.
3+
14
## 0.5.26
25
* Add plusplayer library for Tizen10.0.
36
* Update plusplayer

packages/video_player_avplay/README.md

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ To use this package, add `video_player_avplay` as a dependency in your `pubspec.
1212

1313
```yaml
1414
dependencies:
15-
video_player_avplay: ^0.5.26
15+
video_player_avplay: ^0.6.0
1616
```
1717
1818
Then you can import `video_player_avplay` in your Dart code:
@@ -23,16 +23,36 @@ import 'package:video_player_avplay/video_player.dart';
2323

2424
Note that `video_player_avplay` is not compatible with the original `video_player` plugin. If you're writing a cross-platform app for Tizen and other platforms, it is recommended to create two separate source files and import `video_player` and `video_player_avplay` in the files respectively.
2525

26-
Note that `video_player_avplay` uses a compiled dynamic library, the api-version is your TV version, change it in tizen-manifest.xml:
26+
Change api-version in tizen-manifest.xml according to your TV version.
27+
28+
Note that `video_player_avplay` uses a compiled dynamic library, change the api-version according to your TV version in tizen-manifest.xml :
2729

2830
```xml
2931
<manifest package="xxx" version="1.0.0" api-version="6.0">
3032
```
3133

3234
> [!NOTE]
33-
> This plugin does not provide OS version compatibility.
35+
> This plugin for a specific api-version does not provide OS version compatibility.
36+
> | `api-version` | TizenOS version |
37+
> |:-:|:-:|
38+
> |6.0|6.0|
39+
> |6.5|6.5 ~ 9.0|
40+
> |7.0|7.0 ~ 9.0|
41+
> |8.0|8.0 ~ 9.0|
42+
> |9.0|9.0|
43+
> |10.0|10.0|
44+
>
3445
> When you build an application with this plugin, version-specific [dynamic libraries](https://github.com/flutter-tizen/plugins/tree/master/packages/video_player_avplay/tizen/lib/armel) are packaged together based on the api-version information in tizen-manifest.xml.
3546
> If you are planning to distribute an application that includes this plugin, you will need to build a TPK package for each TizenOS version (api-version in tizen-manifest.xml). Please refer to the [Samsung Developers](https://developer.samsung.com/smarttv/develop) for information on TizenOS versions by [TV model groups](https://developer.samsung.com/smarttv/develop/specifications/tv-model-groups.html).
47+
>
48+
> If you plan to distribute from TizenOS version 6.0 to 10.0, it should be packaged as follows.
49+
> - `<.... api-version="6.0" version="1.0.0" ...> # for TizenOS 6.0.`
50+
> - `<.... api-version="6.5" version="1.0.1" ...> # for TizenOS 6.5 ~ 9.0.`
51+
> - `<.... api-version="10.0" version="1.0.2" ...> # for TizenOS 10.0.`
52+
>
53+
> If you plan to distribute from TizenOS version 7.0 to 10.0, it should be packaged as follows.
54+
> - `<.... api-version="7.0" version="1.0.0" ...> # for TizenOS 7.0 ~ 9.0.`
55+
> - `<.... api-version="10.0" version="1.0.1" ...> # for TizenOS 10.0.`
3656

3757
Note that if you play dash streams, please add dash format when creating the player:
3858
```dart

packages/video_player_avplay/lib/video_player.dart

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import 'package:device_info_plus_tizen/device_info_plus_tizen.dart';
1010
import 'package:flutter/foundation.dart';
1111
import 'package:flutter/material.dart';
1212
import 'package:flutter/services.dart';
13-
import 'package:flutter_tizen/flutter_tizen.dart';
13+
import 'package:flutter_tizen/flutter_tizen.dart' as tizen;
1414

1515
import 'src/closed_caption_file.dart';
1616
import 'src/drm_configs.dart';
@@ -443,15 +443,28 @@ class VideoPlayerController extends ValueNotifier<VideoPlayerValue> {
443443

444444
if ((deviceInfo.platformVersion != null &&
445445
deviceInfo.platformVersion!.isNotEmpty) &&
446-
apiVersion != 'none' &&
447-
(deviceInfo.platformVersion != apiVersion)) {
448-
throw Exception(
449-
'The current TizenOS version(${deviceInfo.platformVersion}) '
450-
'and the app API version($apiVersion) are different. '
451-
'The avplay plugin does not guarantee compatibility with '
452-
'other versions. Therefore, please set the "api-version" '
453-
'in tizen-manifest.xml to match the TizenOS version and rebuild.',
454-
);
446+
tizen.apiVersion != 'none') {
447+
if (deviceInfo.platformVersion != tizen.apiVersion) {
448+
final double? platformVersion =
449+
double.tryParse(deviceInfo.platformVersion!);
450+
final double? apiVersion = double.tryParse(tizen.apiVersion);
451+
if (platformVersion != null && apiVersion != null) {
452+
if (platformVersion == 6.0 || platformVersion == 10.0) {
453+
throw Exception(
454+
'The current TizenOS version is $platformVersion and the app API version($apiVersion). The app API version must also be $platformVersion. '
455+
'The avplay plugin, with an apiVersion of $apiVersion does not guarantee compatibility with other TizenOS versions. Therefore '
456+
'Please set the "api-version" in tizen-manifest.xml to $platformVersion and rebuild.',
457+
);
458+
} else if ((platformVersion >= 6.5 && platformVersion <= 9.0) &&
459+
(apiVersion == 6.0 || apiVersion == 10.0)) {
460+
throw Exception(
461+
'The current TizenOS version is $platformVersion and the app API version($apiVersion). The app API version must be at least 6.5. '
462+
'The avplay plugin, with an apiVersion of $apiVersion does not guarantee compatibility with other TizenOS versions. Therefore '
463+
'Please set the "api-version" in tizen-manifest.xml to a minimum of 6.5 and rebuild.',
464+
);
465+
}
466+
}
467+
}
455468
}
456469
}
457470

packages/video_player_avplay/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: video_player_avplay
22
description: Flutter plugin for displaying inline video on Tizen TV devices.
33
homepage: https://github.com/flutter-tizen/plugins
44
repository: https://github.com/flutter-tizen/plugins/tree/master/packages/video_player_avplay
5-
version: 0.5.26
5+
version: 0.6.0
66

77
environment:
88
sdk: ">=3.1.0 <4.0.0"

0 commit comments

Comments
 (0)