forked from flutter-tizen/plugins
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
127 changed files
with
12,267 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
.DS_Store | ||
.dart_tool/ | ||
|
||
.packages | ||
.pub/ | ||
|
||
build/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
## 0.1.0 | ||
|
||
* Initial release. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
# video_player_avplay | ||
|
||
[![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_avplay` as a dependency in your `pubspec.yaml` file. | ||
|
||
```yaml | ||
dependencies: | ||
video_player_avplay: ^0.1.0 | ||
``` | ||
Then you can import `video_player_avplay` in your Dart code: | ||
|
||
```dart | ||
import 'package:video_player_avplay/video_player.dart'; | ||
``` | ||
|
||
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_avplay` uses a compiled dynamic library, the api-version is your TV version, change it in tizen-manifest.xml: | ||
|
||
```xml | ||
<manifest package="xxx" version="1.0.0" api-version="6.0"> | ||
``` | ||
|
||
### Example | ||
|
||
```dart | ||
import 'package:flutter/material.dart'; | ||
import 'package:video_player_avplay/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 | ||
|
||
TV emulator support is experimental. DRM content playback is not supported on TV emulators. | ||
|
||
The following options are not currently supported. | ||
|
||
- `VideoPlayerOptions.allowBackgroundPlayback` | ||
- `VideoPlayerOptions.mixWithOthers` | ||
|
||
This plugin has the following limitations. | ||
|
||
- The `httpHeaders` option of `VideoPlayerController.network` only support `Cookie` and `User-Agent`. | ||
- 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. | ||
- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# video_player_avplay_example | ||
|
||
Demonstrates how to use the video_player_avplay 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.
Oops, something went wrong.