-
Notifications
You must be signed in to change notification settings - Fork 52
[video_player_videohole] Add video_player_videohole package #550
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
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 2b4bef7
support internal subtitle from stream
hyue7 a6744f8
Modify variables naming style
hyue7 1828ea0
Modify variables naming style
hyue7 66a229b
Update pigeon version to 6.0.1
hyue7 b1d0f99
Fix build error
hyue7 97ddf07
Change textureId to playerId
hyue7 72d80be
modify dart api path
hyue7 35c7d1d
Code format
hyue7 0764a7d
Release drm when failed
hyue7 69660ad
Fix issue of not use static function
hyue7 6440429
Use the existing Caption implementation to show subtitles
swift-kim f1e2c2c
Do not pass window geometry from Dart code
swift-kim 8cdd5c1
Make DrmConfigs into a class
swift-kim 1aed2d9
Resolve some analysis issues
swift-kim d0a57d7
Clean up the player repositioning-related code
swift-kim d6b3728
Redesign the FFI-related interface
swift-kim 75dfaef
Fix naming style in the pigeon file
swift-kim ba550ae
Use Rect (doubles) to compute geometry
swift-kim e1903b0
Change the path of dart_api_dl.h
hyue7 7c7441c
Update project_def.prop
swift-kim 14ea3c8
Remove unexpected player_destroy calls
swift-kim 73a28de
Pass native window handle from the plugin class
swift-kim a71e470
Rename parameters as defined in the pigeon file
swift-kim 17d36ed
More error handling
swift-kim ae806f1
Move PendingCall to a new file
swift-kim 30da5e1
Move ChallengeCb() to the VideoPlayer class
swift-kim 882b58f
Use FindPlayerById() to get player instance
swift-kim 221f828
Use std::vector to store license data
swift-kim 6b1f0f1
Move ParseCreateMessage to VideoPlayerTizenPlugin::Create
swift-kim 38a3a44
VideoPlayer minor code cleanups
swift-kim 5b08a3f
DrmManager minor code cleanups
swift-kim 987ce2d
DrmLicenseHelper partial revert and clean up
swift-kim 7578ccc
Minor update to the example app
swift-kim b37fb46
Make seekTo() async
swift-kim 30a9454
Rename MethodChannelVideoPlayer to VideoPlayerTizen
swift-kim c3f76f5
Update include guards
swift-kim c06c8e4
Enable integration test
swift-kim 3a482e6
Miscellaneous
swift-kim 31b7a60
Print player errors
swift-kim 39919af
Improve the licenseCallback documentation
swift-kim 4c4757e
Update README
swift-kim e4e6db2
Fix a typo
swift-kim File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,124 @@ | ||
| # video_player_videohole | ||
|
|
||
| [](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. | ||
This file contains hidden or 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 hidden or 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_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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.