Skip to content

Commit

Permalink
Fix review comments (#6)
Browse files Browse the repository at this point in the history
* Codes cleanup

* Change message channel Api name

* Refactor track type

* Rename package name

* Update labeler.yml and recipe.yaml

* Not return -1

* Return FlutterError if failed
  • Loading branch information
hyue7 authored Oct 31, 2023
1 parent c505ae8 commit d16a9cc
Show file tree
Hide file tree
Showing 280 changed files with 363 additions and 317 deletions.
2 changes: 2 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@
- packages/url_launcher/**/*
"p: video_player":
- packages/video_player/**/*
"p: video_player_avplay":
- packages/video_player_avplay/**/*
"p: video_player_videohole":
- packages/video_player_videohole/**/*
"p: wakelock":
Expand Down
1 change: 1 addition & 0 deletions .github/recipe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ plugins:
geolocator: []
in_app_purchase: []
network_info_plus: []
video_player_avplay: []
video_player_videohole: []

# Only testable with the drive command: https://github.com/flutter-tizen/plugins/issues/272
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ The _"non-endorsed"_ status means that the plugin is not endorsed by the origina
| [**tizen_package_manager**](packages/tizen_package_manager) | (Tizen-only) | [![pub package](https://img.shields.io/pub/v/tizen_package_manager.svg)](https://pub.dev/packages/tizen_package_manager) | N/A |
| [**tizen_rpc_port**](packages/tizen_rpc_port) | (Tizen-only) | [![pub package](https://img.shields.io/pub/v/tizen_rpc_port.svg)](https://pub.dev/packages/tizen_rpc_port) | N/A |
| [**url_launcher_tizen**](packages/url_launcher) | [url_launcher](https://pub.dev/packages/url_launcher) (1st-party) | [![pub package](https://img.shields.io/pub/v/url_launcher_tizen.svg)](https://pub.dev/packages/url_launcher_tizen) | No |
| [**video_player_avplayer**](packages/video_player_avplayer) | (Tizen-only) | [![pub package](https://img.shields.io/pub/v/video_player_avplayer.svg)](https://pub.dev/packages/video_player_avplayer) | N/A |
| [**video_player_avplay**](packages/video_player_avplay) | (Tizen-only) | [![pub package](https://img.shields.io/pub/v/video_player_avplay.svg)](https://pub.dev/packages/video_player_avplay) | N/A |
| [**video_player_tizen**](packages/video_player) | [video_player](https://pub.dev/packages/video_player) (1st-party) | [![pub package](https://img.shields.io/pub/v/video_player_tizen.svg)](https://pub.dev/packages/video_player_tizen) | No |
| [**video_player_videohole**](packages/video_player_videohole) | (Tizen-only) | [![pub package](https://img.shields.io/pub/v/video_player_videohole.svg)](https://pub.dev/packages/video_player_videohole) | N/A |
| [**wakelock_tizen**](packages/wakelock) | [wakelock](https://pub.dev/packages/wakelock) (3rd-party) | [![pub package](https://img.shields.io/pub/v/wakelock_tizen.svg)](https://pub.dev/packages/wakelock_tizen) | No |
Expand Down Expand Up @@ -92,7 +92,7 @@ The _"non-endorsed"_ status means that the plugin is not endorsed by the origina
| [**tizen_package_manager**](packages/tizen_package_manager) | ✔️ | ✔️ | ✔️ | ✔️ |
| [**tizen_rpc_port**](packages/tizen_rpc_port) | ✔️ | ✔️ | ✔️ | ✔️ |
| [**url_launcher_tizen**](packages/url_launcher) | ✔️ || ✔️ || No browser app |
| [**video_player_avplayer**](packages/video_player_avplayer) ||| ✔️ | ⚠️ | See README for details |
| [**video_player_avplay**](packages/video_player_avplay) ||| ✔️ | ⚠️ | See README for details |
| [**video_player_tizen**](packages/video_player) | ✔️ | ✔️ | ✔️ || TV emulator issue |
| [**video_player_videohole**](packages/video_player_videohole) ||| ✔️ | ⚠️ | See README for details |
| [**wakelock_tizen**](packages/wakelock) | ✔️ | ✔️ ||| Cannot override system settings |
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
# video_player_avplayer
# video_player_avplay

[![pub package](https://img.shields.io/pub/v/video_player_avplayer.svg)](https://pub.dev/packages/video_player_avplayer)
[![pub package](https://img.shields.io/pub/v/video_player_avplay.svg)](https://pub.dev/packages/video_player_avplay)

A downloadable plugin which supports MMPlayer and PlusPlayer(PlusPlayer is a new multimedia player object-oriented designed) on Tizen TV devices.

This plugin is only supported on Tizen TV devices. If you are targeting other types of devices or are not interested in playing DRM content in your app, use [`video_player`](https://pub.dev/packages/video_player) and [`video_player_tizen`](https://pub.dev/packages/video_player_tizen) instead.

## Usage

To use this package, add `video_player_avplayer` as a dependency in your `pubspec.yaml` file.
To use this package, add `video_player_avplay` as a dependency in your `pubspec.yaml` file.

```yaml
dependencies:
video_player_avplayer: ^0.1.0
video_player_avplay: ^0.1.0
```
Then you can import `video_player_avplayer` in your Dart code:
Then you can import `video_player_avplay` in your Dart code:

```dart
import 'package:video_player_avplayer/video_player.dart';
import 'package:video_player_avplay/video_player.dart';
```

Note that `video_player_avplayer` 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_avplayer` in the files respectively.
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.

Note that `video_player_avplayer` uses a compiled dynamic library, the api-version in tizen-manifest.xml is your TV version.
Note that `video_player_avplay` uses a compiled dynamic library, the api-version in tizen-manifest.xml is your TV version.

### Example

```dart
import 'package:flutter/material.dart';
import 'package:video_player_avplayer/video_player.dart';
import 'package:video_player_avplay/video_player.dart';
class RemoteVideo extends StatefulWidget {
const RemoteVideo({Key? key}) : super(key: key);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# video_player_avplayer_example
# video_player_avplay_example

Demonstrates how to use the video_player_avplayer plugin.
Demonstrates how to use the video_player_avplay plugin.

## Getting Started

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import 'package:flutter/services.dart' show rootBundle;
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import 'package:path_provider/path_provider.dart';
import 'package:video_player_avplayer/video_player.dart';
import 'package:video_player_avplay/video_player.dart';

const Duration _playDuration = Duration(seconds: 1);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:http/http.dart' as http;
import 'package:video_player_avplayer/video_player.dart';
import 'package:video_player_avplayer/video_player_platform_interface.dart';
import 'package:video_player_avplay/video_player.dart';
import 'package:video_player_avplay/video_player_platform_interface.dart';

void main() {
runApp(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: video_player_avplayer_example
description: Demonstrates how to use the video_player_avplayer plugin.
name: video_player_avplay_example
description: Demonstrates how to use the video_player_avplay plugin.
publish_to: "none"

environment:
Expand All @@ -10,7 +10,7 @@ dependencies:
flutter:
sdk: flutter
http: ^0.13.0
video_player_avplayer:
video_player_avplay:
path: ../

dev_dependencies:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest package="org.tizen.video_player_avplayer_example" version="1.0.0" api-version="6.0" xmlns="http://tizen.org/ns/packages">
<manifest package="org.tizen.video_player_avplay_example" version="1.0.0" api-version="6.0" xmlns="http://tizen.org/ns/packages">
<profile name="tv"/>
<ui-application appid="org.tizen.video_player_avplayer_example" exec="Runner.dll" type="dotnet" multiple="false" taskmanage="true" nodisplay="false">
<label>video_player_avplayer_example</label>
<ui-application appid="org.tizen.video_player_avplay_example" exec="Runner.dll" type="dotnet" multiple="false" taskmanage="true" nodisplay="false">
<label>video_player_avplay_example</label>
<icon>ic_launcher.png</icon>
<metadata key="http://tizen.org/metadata/prefer_dotnet_aot" value="true"/>
</ui-application>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ class TrackTypeMessage {

int playerId;

int trackType;
String trackType;

Object encode() {
return <Object?>[
Expand All @@ -154,7 +154,7 @@ class TrackTypeMessage {
result as List<Object?>;
return TrackTypeMessage(
playerId: result[0]! as int,
trackType: result[1]! as int,
trackType: result[1]! as String,
);
}
}
Expand All @@ -170,7 +170,7 @@ class SelectedTracksMessage {

int trackId;

int trackType;
String trackType;

Object encode() {
return <Object?>[
Expand All @@ -185,7 +185,7 @@ class SelectedTracksMessage {
return SelectedTracksMessage(
playerId: result[0]! as int,
trackId: result[1]! as int,
trackType: result[2]! as int,
trackType: result[2]! as String,
);
}
}
Expand Down Expand Up @@ -332,8 +332,8 @@ class GeometryMessage {
}
}

class _VideoPlayerVideoholeApiCodec extends StandardMessageCodec {
const _VideoPlayerVideoholeApiCodec();
class _VideoPlayerAvplayApiCodec extends StandardMessageCodec {
const _VideoPlayerAvplayApiCodec();
@override
void writeValue(WriteBuffer buffer, Object? value) {
if (value is CreateMessage) {
Expand Down Expand Up @@ -405,19 +405,19 @@ class _VideoPlayerVideoholeApiCodec extends StandardMessageCodec {
}
}

class VideoPlayerVideoholeApi {
/// Constructor for [VideoPlayerVideoholeApi]. The [binaryMessenger] named argument is
class VideoPlayerAvplayApi {
/// Constructor for [VideoPlayerAvplayApi]. The [binaryMessenger] named argument is
/// available for dependency injection. If it is left null, the default
/// BinaryMessenger will be used which routes to the host platform.
VideoPlayerVideoholeApi({BinaryMessenger? binaryMessenger})
VideoPlayerAvplayApi({BinaryMessenger? binaryMessenger})
: _binaryMessenger = binaryMessenger;
final BinaryMessenger? _binaryMessenger;

static const MessageCodec<Object?> codec = _VideoPlayerVideoholeApiCodec();
static const MessageCodec<Object?> codec = _VideoPlayerAvplayApiCodec();

Future<void> initialize() async {
final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
'dev.flutter.pigeon.VideoPlayerVideoholeApi.initialize', codec,
'dev.flutter.pigeon.VideoPlayerAvplayApi.initialize', codec,
binaryMessenger: _binaryMessenger);
final List<Object?>? replyList = await channel.send(null) as List<Object?>?;
if (replyList == null) {
Expand All @@ -438,7 +438,7 @@ class VideoPlayerVideoholeApi {

Future<PlayerMessage> create(CreateMessage arg_msg) async {
final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
'dev.flutter.pigeon.VideoPlayerVideoholeApi.create', codec,
'dev.flutter.pigeon.VideoPlayerAvplayApi.create', codec,
binaryMessenger: _binaryMessenger);
final List<Object?>? replyList =
await channel.send(<Object?>[arg_msg]) as List<Object?>?;
Expand All @@ -465,7 +465,7 @@ class VideoPlayerVideoholeApi {

Future<void> dispose(PlayerMessage arg_msg) async {
final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
'dev.flutter.pigeon.VideoPlayerVideoholeApi.dispose', codec,
'dev.flutter.pigeon.VideoPlayerAvplayApi.dispose', codec,
binaryMessenger: _binaryMessenger);
final List<Object?>? replyList =
await channel.send(<Object?>[arg_msg]) as List<Object?>?;
Expand All @@ -487,7 +487,7 @@ class VideoPlayerVideoholeApi {

Future<void> setLooping(LoopingMessage arg_msg) async {
final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
'dev.flutter.pigeon.VideoPlayerVideoholeApi.setLooping', codec,
'dev.flutter.pigeon.VideoPlayerAvplayApi.setLooping', codec,
binaryMessenger: _binaryMessenger);
final List<Object?>? replyList =
await channel.send(<Object?>[arg_msg]) as List<Object?>?;
Expand All @@ -509,7 +509,7 @@ class VideoPlayerVideoholeApi {

Future<void> setVolume(VolumeMessage arg_msg) async {
final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
'dev.flutter.pigeon.VideoPlayerVideoholeApi.setVolume', codec,
'dev.flutter.pigeon.VideoPlayerAvplayApi.setVolume', codec,
binaryMessenger: _binaryMessenger);
final List<Object?>? replyList =
await channel.send(<Object?>[arg_msg]) as List<Object?>?;
Expand All @@ -531,7 +531,7 @@ class VideoPlayerVideoholeApi {

Future<void> setPlaybackSpeed(PlaybackSpeedMessage arg_msg) async {
final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
'dev.flutter.pigeon.VideoPlayerVideoholeApi.setPlaybackSpeed', codec,
'dev.flutter.pigeon.VideoPlayerAvplayApi.setPlaybackSpeed', codec,
binaryMessenger: _binaryMessenger);
final List<Object?>? replyList =
await channel.send(<Object?>[arg_msg]) as List<Object?>?;
Expand All @@ -553,7 +553,7 @@ class VideoPlayerVideoholeApi {

Future<void> play(PlayerMessage arg_msg) async {
final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
'dev.flutter.pigeon.VideoPlayerVideoholeApi.play', codec,
'dev.flutter.pigeon.VideoPlayerAvplayApi.play', codec,
binaryMessenger: _binaryMessenger);
final List<Object?>? replyList =
await channel.send(<Object?>[arg_msg]) as List<Object?>?;
Expand All @@ -575,7 +575,7 @@ class VideoPlayerVideoholeApi {

Future<bool> setDeactivate(PlayerMessage arg_msg) async {
final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
'dev.flutter.pigeon.VideoPlayerVideoholeApi.setDeactivate', codec,
'dev.flutter.pigeon.VideoPlayerAvplayApi.setDeactivate', codec,
binaryMessenger: _binaryMessenger);
final List<Object?>? replyList =
await channel.send(<Object?>[arg_msg]) as List<Object?>?;
Expand All @@ -602,7 +602,7 @@ class VideoPlayerVideoholeApi {

Future<bool> setActivate(PlayerMessage arg_msg) async {
final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
'dev.flutter.pigeon.VideoPlayerVideoholeApi.setActivate', codec,
'dev.flutter.pigeon.VideoPlayerAvplayApi.setActivate', codec,
binaryMessenger: _binaryMessenger);
final List<Object?>? replyList =
await channel.send(<Object?>[arg_msg]) as List<Object?>?;
Expand All @@ -629,7 +629,7 @@ class VideoPlayerVideoholeApi {

Future<TrackMessage> track(TrackTypeMessage arg_msg) async {
final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
'dev.flutter.pigeon.VideoPlayerVideoholeApi.track', codec,
'dev.flutter.pigeon.VideoPlayerAvplayApi.track', codec,
binaryMessenger: _binaryMessenger);
final List<Object?>? replyList =
await channel.send(<Object?>[arg_msg]) as List<Object?>?;
Expand All @@ -656,7 +656,7 @@ class VideoPlayerVideoholeApi {

Future<bool> setTrackSelection(SelectedTracksMessage arg_msg) async {
final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
'dev.flutter.pigeon.VideoPlayerVideoholeApi.setTrackSelection', codec,
'dev.flutter.pigeon.VideoPlayerAvplayApi.setTrackSelection', codec,
binaryMessenger: _binaryMessenger);
final List<Object?>? replyList =
await channel.send(<Object?>[arg_msg]) as List<Object?>?;
Expand All @@ -683,7 +683,7 @@ class VideoPlayerVideoholeApi {

Future<PositionMessage> position(PlayerMessage arg_msg) async {
final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
'dev.flutter.pigeon.VideoPlayerVideoholeApi.position', codec,
'dev.flutter.pigeon.VideoPlayerAvplayApi.position', codec,
binaryMessenger: _binaryMessenger);
final List<Object?>? replyList =
await channel.send(<Object?>[arg_msg]) as List<Object?>?;
Expand All @@ -710,7 +710,7 @@ class VideoPlayerVideoholeApi {

Future<void> seekTo(PositionMessage arg_msg) async {
final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
'dev.flutter.pigeon.VideoPlayerVideoholeApi.seekTo', codec,
'dev.flutter.pigeon.VideoPlayerAvplayApi.seekTo', codec,
binaryMessenger: _binaryMessenger);
final List<Object?>? replyList =
await channel.send(<Object?>[arg_msg]) as List<Object?>?;
Expand All @@ -732,7 +732,7 @@ class VideoPlayerVideoholeApi {

Future<void> pause(PlayerMessage arg_msg) async {
final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
'dev.flutter.pigeon.VideoPlayerVideoholeApi.pause', codec,
'dev.flutter.pigeon.VideoPlayerAvplayApi.pause', codec,
binaryMessenger: _binaryMessenger);
final List<Object?>? replyList =
await channel.send(<Object?>[arg_msg]) as List<Object?>?;
Expand All @@ -754,7 +754,7 @@ class VideoPlayerVideoholeApi {

Future<void> setMixWithOthers(MixWithOthersMessage arg_msg) async {
final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
'dev.flutter.pigeon.VideoPlayerVideoholeApi.setMixWithOthers', codec,
'dev.flutter.pigeon.VideoPlayerAvplayApi.setMixWithOthers', codec,
binaryMessenger: _binaryMessenger);
final List<Object?>? replyList =
await channel.send(<Object?>[arg_msg]) as List<Object?>?;
Expand All @@ -776,7 +776,7 @@ class VideoPlayerVideoholeApi {

Future<void> setDisplayGeometry(GeometryMessage arg_msg) async {
final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
'dev.flutter.pigeon.VideoPlayerVideoholeApi.setDisplayGeometry', codec,
'dev.flutter.pigeon.VideoPlayerAvplayApi.setDisplayGeometry', codec,
binaryMessenger: _binaryMessenger);
final List<Object?>? replyList =
await channel.send(<Object?>[arg_msg]) as List<Object?>?;
Expand Down
Loading

0 comments on commit d16a9cc

Please sign in to comment.