Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
345399f
version 1.0.0
hyue7 Oct 18, 2022
81c8ebc
Code format
hyue7 Oct 19, 2022
0502027
Code format
hyue7 Oct 20, 2022
35385e6
remove unnecessary_import
hyue7 Oct 20, 2022
60de883
modify code
hyue7 Oct 20, 2022
d4552fb
device only supports Tizen tv
hyue7 Oct 21, 2022
1b1ada7
Remove the unnecessary code
hyue7 Oct 27, 2022
9e94c83
remove unnecessary code and modify the variable initialization
hyue7 Oct 28, 2022
2b9b76d
change the log format
hyue7 Oct 28, 2022
98a320a
Rename variables and modify code format with Google C++ style
hyue7 Nov 4, 2022
24448aa
fix the issue that cannot play asset videos
hyue7 Nov 11, 2022
3ef24fd
Update DRM related code
hyue7 Nov 14, 2022
bee28ba
Change TextureMessage into PlayerMessage
hyue7 Nov 15, 2022
ebf467f
Fix issue about dynamic loading of DRM
hyue7 Nov 18, 2022
b1b585f
use C++ cast and remove goto
hyue7 Nov 18, 2022
1a729ce
Remove pigeon path and fix return fail case issue
hyue7 Nov 25, 2022
6bfa457
Fix get window geometry issue
hyue7 Nov 25, 2022
056d847
Code format
hyue7 Nov 30, 2022
d5264a8
Fix return empty error message issue
hyue7 Nov 30, 2022
4106044
Remove unnecessary package and apply c++ style
hyue7 Dec 6, 2022
32c945c
Add license request callback
hyue7 Jan 6, 2023
1302979
Update callback of requesting drm license
hyue7 Jan 10, 2023
e144cb3
update request drm license through ffi
hyue7 Jan 13, 2023
052720e
fixed the issue about license request callback
hyue7 Jan 16, 2023
8d34fe8
set license request callback in example code
hyue7 Jan 17, 2023
f299572
support internal subtitles from stream
hyue7 Feb 9, 2023
a57f343
Merge remote-tracking branch 'upstream/master'
hyue7 Feb 9, 2023
9555351
Merge branch 'master' of https://github.com/hyue7/plugins
hyue7 Feb 9, 2023
e215d54
modify README
hyue7 Feb 9, 2023
05268f5
Modify variables naming style
hyue7 Mar 22, 2023
f6e9952
Modify variables naming style
hyue7 Mar 22, 2023
180b311
Merge remote-tracking branch 'remotes/upstream/master'
hyue7 Mar 23, 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
44 changes: 44 additions & 0 deletions packages/video_player_videohole/.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/
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 @@
## 1.0.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) 2020 Samsung Electronics Co., Ltd. All rights reserved.
Copyright 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 name of Google Inc. nor the names of its
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.
121 changes: 121 additions & 0 deletions packages/video_player_videohole/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
# video_player_videohole

A video_player_videohole flutter plugin only for Tizen TV devices, supports play DRM(playready & widevine).

## Required privileges

To use this plugin in a Tizen application, you may need to add 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://tizen.org/privilege/network.get</privilege>
<privilege>http://tizen.org/privilege/download</privilege>
<privilege>http://tizen.org/privilege/push</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 URLs from network.
- The drmplay privilege (http://developer.samsung.com/privilege/drmplay) is required to play DRM video files.

To play DRM with this streaming player, you need to have [partner level certificate](https://developer.samsung.com/tv-seller-office/guides/membership/becoming-partner.html).

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

## Example

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

void main() => runApp(VideoApp());

class VideoApp extends StatefulWidget {
@override
_VideoAppState createState() => _VideoAppState();
}

class _VideoAppState extends State<VideoApp> {
VideoPlayerController _controller;

@override
void initState() {
super.initState();
_controller = VideoPlayerController.network(
'https://media.w3.org/2010/05/bunny/trailer.mp4',
);

_controller.addListener(() {
setState(() {});
});
_controller.setLooping(true);
_controller.initialize().then((_) => setState(() {}));
_controller.play();
}

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

@override
Widget build(BuildContext context) {
return SingleChildScrollView(
child: Column(
children: <Widget>[
Container(padding: const EdgeInsets.only(top: 20.0)),
const Text('Video Demo'),
Container(
padding: const EdgeInsets.all(20),
child: AspectRatio(
aspectRatio: _controller.value.aspectRatio,
child: Stack(
alignment: Alignment.bottomCenter,
children: <Widget>[
VideoPlayer(_controller),
// Set internal subtitle from stream.
ClosedCaption(
text: _controller.value.subtitleText,
isSubtitle: _controller.value.isSubtitle),
_ControlsOverlay(controller: _controller),
VideoProgressIndicator(_controller, allowScrubbing: true),
],
),
),
),
],
),
);
}
}
```

## Usage

```yaml
dependencies:
video_player_videohole: ^1.0.0
```

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

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

## Limitations

The 'httpheaders' option for 'VideoPlayerController.network' and 'mixWithOthers' option of 'VideoPlayerOptions' will be silently ignored in Tizen platform.

This plugin has some limitations on TV:

- The 'setPlaybackSpeed' method will fail if triggered within last 3 seconds.
- The playback speed will reset to 1.0 when video is replayed in loop mode.
- The 'seekTo' method works only when playback speed is 1.0, and it sets video position to the nearest key frame which may differ from the passed argument.
- The 'player_set_subtitle_updated_cb' can't support Dash sidecar subtitle on Tizen 6.0/6.5, but support on Tizen 7.0.
Empty file.
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).
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

import 'dart:async';

import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import 'package:video_player_videohole/video_player.dart';

const Duration _playDuration = Duration(seconds: 1);

void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
testWidgets(
'can substitute one controller by another without crashing',
(WidgetTester tester) async {
// Use WebM for web to allow CI to use Chromium.
const String videoAssetKey =
kIsWeb ? 'assets/Butterfly-209.webm' : 'assets/Butterfly-209.mp4';

final VideoPlayerController controller = VideoPlayerController.asset(
videoAssetKey,
);
final VideoPlayerController another = VideoPlayerController.asset(
videoAssetKey,
);
await controller.initialize();
await another.initialize();
await controller.setVolume(0);
await another.setVolume(0);

final Completer<void> started = Completer<void>();
final Completer<void> ended = Completer<void>();

another.addListener(() {
if (another.value.isBuffering && !started.isCompleted) {
started.complete();
}
if (started.isCompleted &&
!another.value.isBuffering &&
!ended.isCompleted) {
ended.complete();
}
});

// Inject a widget with `controller`...
await tester.pumpWidget(renderVideoWidget(controller));
await controller.play();
await tester.pumpAndSettle(_playDuration);
await controller.pause();

// Disposing controller causes the Widget to crash in the next line
// (Issue https://github.com/flutter/flutter/issues/90046)
await controller.dispose();

// Now replace it with `another` controller...
await tester.pumpWidget(renderVideoWidget(another));
await another.play();
await another.seekTo(const Duration(seconds: 5));
await tester.pumpAndSettle(_playDuration);
await another.pause();

// Expect that `another` played.
expect(another.value.position,
(Duration position) => position > const Duration(seconds: 0));

await expectLater(started.future, completes);
await expectLater(ended.future, completes);
},
skip: !(kIsWeb || defaultTargetPlatform == TargetPlatform.android),
);
}

Widget renderVideoWidget(VideoPlayerController controller) {
return Material(
elevation: 0,
child: Directionality(
textDirection: TextDirection.ltr,
child: Center(
child: AspectRatio(
key: const Key('same'),
aspectRatio: controller.value.aspectRatio,
child: VideoPlayer(controller),
),
),
),
);
}
Loading