Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
17 changes: 12 additions & 5 deletions packages/video_player/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,28 @@

## 2.0.0

* Appaly new common texture APIs
* Appaly new common texture APIs.

## 2.0.1

* Update integration_test
* Update integration_test.

## 2.2.0

* Update video_player to 2.2.3
* Update platform interface to 4.2.0
* Update video_player to 2.2.3.
* Update platform interface to 4.2.0.

## 2.2.1

* Update README
* Update README.

## 2.2.2

* Fix `seekTo` so that it returns when seeking is completed.

## 2.3.0

* Fix a freezing issue on Flutter 2.5 or above.
* Never return empty error messages to avoid null reference exceptions.
* Update video_player to 2.2.6 and update the example app.
* Minor cleanups.
24 changes: 12 additions & 12 deletions packages/video_player/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ The Tizen implementation of [`video_player`](https://github.com/flutter/plugins/

## Required privileges

To use this plugin in a Tizen application, the mediastorage, externalstorage and internet privileges are required. Add below lines under the `<manifest>` section in your `tizen-manifest.xml` file.
To use this plugin in a Tizen application, you may need to declare the following privileges in your `tizen-manifest.xml` file.

```xml
<privileges>
Expand All @@ -14,20 +14,20 @@ To use this plugin in a Tizen application, the mediastorage, externalstorage and
</privileges>
```

- The mediastorage privilege (`http://tizen.org/privilege/mediastorage`) must be added to play video files located in the internal storage.
- The externalstorage privilege (`http://tizen.org/privilege/externalstorage`) must be added to play video files located in the external storage.
- The internet privilege (`http://tizen.org/privilege/internet`) must be added to play any URLs from network.
- 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.

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

## Usage

This package is not an _endorsed_ implementation of `video_player`. Therefore, you have to include `video_player_tizen` alongside `video_player` as dependencies in your `pubspec.yaml` file.

```yaml
dependencies:
video_player: ^2.2.3
video_player_tizen: ^2.2.2
video_player: ^2.2.6
video_player_tizen: ^2.3.0
```

Then you can import `video_player` in your Dart code:
Expand All @@ -36,14 +36,14 @@ Then you can import `video_player` in your Dart code:
import 'package:video_player/video_player.dart';
```

For how to use the plugin, see https://github.com/flutter/plugins/tree/master/packages/video_player/video_player#usage.
For how to use the plugin, see https://github.com/flutter/plugins/tree/master/packages/video_player/video_player#example.

## Limitations

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

This plugin has some limitations on TV:
This plugin has some limitations on TV devices.

- The 'setPlaybackSpeed' method will fail if triggered within last 3 seconds.
- 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 `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.
7 changes: 7 additions & 0 deletions packages/video_player/example/assets/bumble_bee_captions.vtt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
WEBVTT

00:00:00.200 --> 00:00:01.750
[ Birds chirping ]

00:00:02.300 --> 00:00:05.000
[ Buzzing ]
7 changes: 4 additions & 3 deletions packages/video_player/example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

/// An example of using the plugin, controlling lifecycle and playback of the
/// video.

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:video_player/video_player.dart';
Expand Down Expand Up @@ -210,8 +209,9 @@ class _BumbleBeeRemoteVideoState extends State<_BumbleBeeRemoteVideo> {

Future<ClosedCaptionFile> _loadCaptions() async {
final String fileContents = await DefaultAssetBundle.of(context)
.loadString('assets/bumble_bee_captions.srt');
return SubRipCaptionFile(fileContents);
.loadString('assets/bumble_bee_captions.vtt');
return WebVTTCaptionFile(
fileContents); // For vtt files, use WebVTTCaptionFile
}

@override
Expand Down Expand Up @@ -297,6 +297,7 @@ class _ControlsOverlay extends StatelessWidget {
Icons.play_arrow,
color: Colors.white,
size: 100.0,
semanticLabel: 'Play',
),
),
),
Expand Down
1 change: 1 addition & 0 deletions packages/video_player/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ flutter:
- assets/flutter-mark-square-64.png
- assets/Butterfly-209.mp4
- assets/bumble_bee_captions.srt
- assets/bumble_bee_captions.vtt
uses-material-design: true

environment:
Expand Down
2 changes: 1 addition & 1 deletion packages/video_player/example/tizen/Runner.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Tizen.NET.Sdk/1.1.5">
<Project Sdk="Tizen.NET.Sdk/1.1.6">

<PropertyGroup>
<OutputType>Exe</OutputType>
Expand Down
2 changes: 1 addition & 1 deletion packages/video_player/example/tizen/tizen-manifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest package="org.tizen.video_player_tizen_example" version="1.0.0" api-version="4.0" xmlns="http://tizen.org/ns/packages">
<profile name="common"/>
<ui-application appid="org.tizen.video_player_tizen_example" exec="Runner.dll" type="dotnet" multiple="false" taskmanage="true" nodisplay="false" api-version="4" launch_mode="single">
<ui-application appid="org.tizen.video_player_tizen_example" exec="Runner.dll" type="dotnet" multiple="false" taskmanage="true" nodisplay="false" api-version="4">
<label>video_player_tizen_example</label>
<icon>ic_launcher.png</icon>
<metadata key="http://tizen.org/metadata/prefer_dotnet_aot" value="true"/>
Expand Down
2 changes: 1 addition & 1 deletion packages/video_player/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: Flutter plugin for displaying inline video with other Flutter
widgets on Tizen.
homepage: https://github.com/flutter-tizen/plugins
repository: https://github.com/flutter-tizen/plugins/tree/master/packages/video_player
version: 2.2.2
version: 2.3.0

flutter:
plugin:
Expand Down
3 changes: 3 additions & 0 deletions packages/video_player/tizen/src/message.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
#include <flutter/binary_messenger.h>
#include <flutter/encodable_value.h>

#include <functional>
#include <string>

#include "video_player_error.h"

class TextureMessage {
Expand Down
6 changes: 3 additions & 3 deletions packages/video_player/tizen/src/video_player.cc
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,8 @@ void VideoPlayer::onInterrupted(player_interrupted_code_e code, void *data) {

if (player->event_sink_) {
LOG_INFO("[VideoPlayer.onInterrupted] send error event");
player->event_sink_->Error("Video player is interrupted", "");
player->event_sink_->Error("Interrupted error",
"Video player has been interrupted.");
}
}

Expand All @@ -539,8 +540,7 @@ void VideoPlayer::onErrorOccurred(int code, void *data) {

if (player->event_sink_) {
LOG_INFO("[VideoPlayer.onErrorOccurred] send error event");
player->event_sink_->Error("Video player had error",
get_error_message(code));
player->event_sink_->Error("Player error", get_error_message(code));
}
}

Expand Down
2 changes: 2 additions & 0 deletions packages/video_player/tizen/src/video_player.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
#include <flutter/plugin_registrar.h>
#include <player.h>

#include <functional>
#include <memory>
#include <mutex>
#include <string>

Expand Down
6 changes: 5 additions & 1 deletion packages/video_player/tizen/src/video_player_tizen_plugin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
#include <flutter/plugin_registrar.h>
#include <flutter/standard_method_codec.h>

#include <map>
#include <memory>
#include <string>

#include "flutter_texture_registrar.h"
#include "log.h"
#include "message.h"
Expand Down Expand Up @@ -102,7 +106,7 @@ TextureMessage VideoPlayerTizenPlugin::create(const CreateMessage &createMsg) {
LOG_DEBUG(
"[VideoPlayerTizenPlugin.create] failed to get resource path "
"of package");
throw VideoPlayerError("failed to get resource path", "");
throw VideoPlayerError("Internal error", "Failed to get resource path.");
}
}
LOG_DEBUG("[VideoPlayerTizenPlugin.create] uri of video player: %s",
Expand Down