Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
ee52c3e
add video_player_videohole package
hyue7 Jan 18, 2023
2b4bef7
support internal subtitle from stream
hyue7 Feb 9, 2023
a6744f8
Modify variables naming style
hyue7 Mar 22, 2023
1828ea0
Modify variables naming style
hyue7 Mar 22, 2023
66a229b
Update pigeon version to 6.0.1
hyue7 Mar 24, 2023
b1d0f99
Fix build error
hyue7 Mar 24, 2023
97ddf07
Change textureId to playerId
hyue7 Mar 30, 2023
72d80be
modify dart api path
hyue7 Mar 30, 2023
35c7d1d
Code format
hyue7 Mar 30, 2023
0764a7d
Release drm when failed
hyue7 Mar 30, 2023
69660ad
Fix issue of not use static function
hyue7 Apr 3, 2023
6440429
Use the existing Caption implementation to show subtitles
swift-kim Apr 7, 2023
f1e2c2c
Do not pass window geometry from Dart code
swift-kim Apr 17, 2023
8cdd5c1
Make DrmConfigs into a class
swift-kim Apr 17, 2023
1aed2d9
Resolve some analysis issues
swift-kim Apr 17, 2023
d0a57d7
Clean up the player repositioning-related code
swift-kim Apr 17, 2023
d6b3728
Redesign the FFI-related interface
swift-kim Apr 18, 2023
75dfaef
Fix naming style in the pigeon file
swift-kim Apr 18, 2023
ba550ae
Use Rect (doubles) to compute geometry
swift-kim Apr 18, 2023
e1903b0
Change the path of dart_api_dl.h
hyue7 Apr 21, 2023
7c7441c
Update project_def.prop
swift-kim Apr 20, 2023
14ea3c8
Remove unexpected player_destroy calls
swift-kim Apr 20, 2023
73a28de
Pass native window handle from the plugin class
swift-kim Apr 21, 2023
a71e470
Rename parameters as defined in the pigeon file
swift-kim Apr 21, 2023
17d36ed
More error handling
swift-kim Apr 21, 2023
ae806f1
Move PendingCall to a new file
swift-kim Apr 21, 2023
30da5e1
Move ChallengeCb() to the VideoPlayer class
swift-kim Apr 21, 2023
882b58f
Use FindPlayerById() to get player instance
swift-kim Apr 24, 2023
221f828
Use std::vector to store license data
swift-kim Apr 24, 2023
6b1f0f1
Move ParseCreateMessage to VideoPlayerTizenPlugin::Create
swift-kim Apr 24, 2023
38a3a44
VideoPlayer minor code cleanups
swift-kim Apr 25, 2023
5b08a3f
DrmManager minor code cleanups
swift-kim Apr 25, 2023
987ce2d
DrmLicenseHelper partial revert and clean up
swift-kim Apr 25, 2023
7578ccc
Minor update to the example app
swift-kim Apr 25, 2023
b37fb46
Make seekTo() async
swift-kim Apr 27, 2023
30a9454
Rename MethodChannelVideoPlayer to VideoPlayerTizen
swift-kim Apr 27, 2023
c3f76f5
Update include guards
swift-kim Apr 27, 2023
c06c8e4
Enable integration test
swift-kim Apr 27, 2023
3a482e6
Miscellaneous
swift-kim Apr 27, 2023
31b7a60
Print player errors
swift-kim Apr 28, 2023
39919af
Improve the licenseCallback documentation
swift-kim Apr 28, 2023
4c4757e
Update README
swift-kim Apr 28, 2023
e4e6db2
Fix a typo
swift-kim May 3, 2023
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
2 changes: 2 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@
- packages/url_launcher/**/*
"p: video_player":
- packages/video_player/**/*
"p: video_player_videohole":
- packages/video_player_videohole/**/*
"p: wakelock":
- packages/wakelock/**/*
"p: wearable_rotary":
Expand Down
1 change: 1 addition & 0 deletions .github/recipe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ plugins:
flutter_webrtc: []
geolocator: []
network_info_plus: []
video_player_videohole: []

# Only testable with the drive command: https://github.com/flutter-tizen/plugins/issues/272
tizen_app_control: []
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ The _"non-endorsed"_ status means that the plugin is not endorsed by the origina
| [**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_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 |
| [**wearable_rotary**](packages/wearable_rotary) | (Tizen-only) | [![pub package](https://img.shields.io/pub/v/wearable_rotary.svg)](https://pub.dev/packages/wearable_rotary) | N/A |
| [**webview_flutter_lwe**](packages/webview_flutter_lwe) | [webview_flutter](https://pub.dev/packages/webview_flutter) (1st-party) | [![pub package](https://img.shields.io/pub/v/webview_flutter_lwe.svg)](https://pub.dev/packages/webview_flutter_lwe) | No |
Expand All @@ -56,7 +57,7 @@ The _"non-endorsed"_ status means that the plugin is not endorsed by the origina

| Package name | API level | Watch | Watch<br>emulator | TV | TV<br>emulator | Remarks |
|-|:-:|:-:|:-:|:-:|:-:|-|
| [**audioplayers_tizen**](packages/audioplayers) | 4.0 | ✔️ | ✔️ | ️ | ⚠️ | Functional limitations |
| [**audioplayers_tizen**](packages/audioplayers) | 4.0 | ✔️ | ✔️ | ️ | ✔️ |
| [**battery_plus_tizen**](packages/battery_plus) | 4.0 | ✔️ | ✔️ | ❌ | ❌ | No battery |
| [**camera_tizen**](packages/camera) | 4.0 | ❌ | ❌ | ❌ | ❌ | No camera |
| [**connectivity_plus_tizen**](packages/connectivity_plus) | 4.0 | ✔️ | ⚠️ | ✔️ | ✔️ | Returns incorrect connection status |
Expand Down Expand Up @@ -88,9 +89,9 @@ The _"non-endorsed"_ status means that the plugin is not endorsed by the origina
| [**tizen_package_manager**](packages/tizen_package_manager) | 4.0 | ✔️ | ✔️ | ✔️ | ✔️ |
| [**tizen_rpc_port**](packages/tizen_rpc_port) | 6.5 | ✔️ | ✔️ | ✔️ | ✔️ |
| [**url_launcher_tizen**](packages/url_launcher) | 4.0 | ✔️ | ❌ | ✔️ | ❌ | No browser app |
| [**video_player_tizen**](packages/video_player) | 4.0 | ✔️ | ✔️ | ⚠️ | ❌ | Functional limitations,<br>TV emulator issue |
| [**video_player_tizen**](packages/video_player) | 4.0 | ✔️ | ✔️ | ✔️ | ❌ | TV emulator issue |
| [**video_player_videohole**](packages/video_player_videohole) | 4.0 | ❌ | ❌ | ✔️ | ❌ | Only for TV devices |
| [**wakelock_tizen**](packages/wakelock) | 4.0 | ✔️ | ✔️ | ❌ | ❌ | Cannot override system settings |
| [**wearable_rotary**](packages/wearable_rotary) | 4.0 | ✔️ | ✔️ | ❌ | ❌ | Not applicable for TV |
| [**webview_flutter_lwe**](packages/webview_flutter_lwe) | 5.5 | ✔️ | ✔️ | ✔️ | ✔️ | Not for production use |
| [**webview_flutter_tizen**](packages/webview_flutter) | 5.5 | ❌ | ❌ | ✔️ | ✔️ | API not supported |

7 changes: 7 additions & 0 deletions packages/video_player_videohole/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.DS_Store
.dart_tool/

.packages
.pub/

build/
3 changes: 3 additions & 0 deletions packages/video_player_videohole/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## 0.1.0

* Initial release.
26 changes: 26 additions & 0 deletions packages/video_player_videohole/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Copyright (c) 2023 Samsung Electronics Co., Ltd. All rights reserved.
Copyright (c) 2013 The Flutter Authors. All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
* Neither the names of the copyright holders nor the names of the
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
124 changes: 124 additions & 0 deletions packages/video_player_videohole/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
# video_player_videohole

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

A fork of the [`video_player`](https://pub.dev/packages/video_player) plugin to support playback of DRM streams (Widevine and PlayReady) on Tizen TV devices.

This plugin is only supported on Tizen TV devices. If you are targeting other device types or don't plan to play 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_videohole` as a dependency in your `pubspec.yaml` file.

```yaml
dependencies:
video_player_videohole: ^0.1.0
```

Then you can import `video_player_videohole` in your Dart code:

```dart
import 'package:video_player_videohole/video_player.dart';
```

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

### Example

```dart
import 'package:flutter/material.dart';
import 'package:video_player_videohole/video_player.dart';

class RemoteVideo extends StatefulWidget {
const RemoteVideo({Key? key}) : super(key: key);

@override
State<RemoteVideo> createState() => _RemoteVideoState();
}

class _RemoteVideoState extends State<RemoteVideo> {
late VideoPlayerController _controller;

@override
void initState() {
super.initState();
_controller = VideoPlayerController.network(
'https://media.w3.org/2010/05/bunny/trailer.mp4',
drmConfigs: const DrmConfigs(
type: DrmType.playready,
licenseServerUrl:
'http://test.playready.microsoft.com/service/rightsmanager.asmx',
),
);
_controller.addListener(() => setState(() {}));
_controller.initialize().then((_) => setState(() {}));
}

@override
void dispose() {
_controller.dispose();
super.dispose();
}

@override
Widget build(BuildContext context) {
return Center(
child: AspectRatio(
aspectRatio: _controller.value.aspectRatio,
child: Stack(
alignment: Alignment.bottomCenter,
children: <Widget>[
VideoPlayer(_controller),
ClosedCaption(text: _controller.value.caption.text),
GestureDetector(
onTap: () {
_controller.value.isPlaying
? _controller.pause()
: _controller.play();
},
),
VideoProgressIndicator(_controller, allowScrubbing: true),
],
),
),
);
}
}
```

## Required privileges

To use this plugin, you may need to declare the following privileges in your `tizen-manifest.xml` file.

```xml
<privileges>
<privilege>http://tizen.org/privilege/mediastorage</privilege>
<privilege>http://tizen.org/privilege/externalstorage</privilege>
<privilege>http://tizen.org/privilege/internet</privilege>
<privilege>http://developer.samsung.com/privilege/drmplay</privilege>
</privileges>
```

- The mediastorage privilege (`http://tizen.org/privilege/mediastorage`) is required to play video files located in the internal storage.
- The externalstorage privilege (`http://tizen.org/privilege/externalstorage`) is required to play video files located in the external storage.
- The internet privilege (`http://tizen.org/privilege/internet`) is required to play any URL from the network.
- The drmplay privilege (`http://developer.samsung.com/privilege/drmplay`) is required to play DRM content. The app must be signed with a [partner-level certificate](https://docs.tizen.org/application/dotnet/get-started/certificates/creating-certificates) to use this privilege.

For detailed information on Tizen privileges, see [Tizen Docs: API Privileges](https://docs.tizen.org/application/dotnet/get-started/api-privileges).

## Limitations

This plugin is not supported on TV emulators.

The following options are not currently supported.

- The `httpHeaders` option of `VideoPlayerController.network`
- `VideoPlayerOptions.allowBackgroundPlayback`
- `VideoPlayerOptions.mixWithOthers`

This plugin has the following limitations.

- The `setPlaybackSpeed` method will fail if triggered within the last 3 seconds of the video.
- The playback speed will reset to 1.0 when the video is replayed in loop mode.
- The `seekTo` method works only when the playback speed is 1.0, and it sets the video position to the nearest keyframe, not the exact value passed.
- Dash sidecar subtitles are only supported on Tizen 7.0 and later.
44 changes: 44 additions & 0 deletions packages/video_player_videohole/example/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/

# IntelliJ related
*.iml
*.ipr
*.iws
.idea/

# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
#.vscode/

# Flutter/Dart/Pub related
**/doc/api/
**/ios/Flutter/.last_build_id
.dart_tool/
.flutter-plugins
.flutter-plugins-dependencies
.packages
.pub-cache/
.pub/
/build/

# Web related
lib/generated_plugin_registrant.dart

# Symbolication related
app.*.symbols

# Obfuscation related
app.*.map.json

#vscode
/.vscode/
7 changes: 7 additions & 0 deletions packages/video_player_videohole/example/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# video_player_videohole_example

Demonstrates how to use the video_player_videohole plugin.

## Getting Started

To run this app on your Tizen device, use [flutter-tizen](https://github.com/flutter-tizen/flutter-tizen).
Binary file not shown.
Binary file not shown.
Loading