Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.
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
6 changes: 6 additions & 0 deletions packages/video_player/video_player_android/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 2.3.1

* Renames internal method channels to avoid potential confusion with the
default implementation's method channel.
* Updates Pigeon to 2.0.1.

## 2.3.0

* Updates Pigeon to ^1.0.16.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// 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.
// Autogenerated from Pigeon (v1.0.16), do not edit directly.
// Autogenerated from Pigeon (v2.0.1), do not edit directly.
// See also: https://pub.dev/packages/pigeon

package io.flutter.plugins.videoplayer;
Expand Down Expand Up @@ -557,10 +557,10 @@ Map<String, Object> toMap() {
}
}

private static class VideoPlayerApiCodec extends StandardMessageCodec {
public static final VideoPlayerApiCodec INSTANCE = new VideoPlayerApiCodec();
private static class AndroidVideoPlayerApiCodec extends StandardMessageCodec {
public static final AndroidVideoPlayerApiCodec INSTANCE = new AndroidVideoPlayerApiCodec();

private VideoPlayerApiCodec() {}
private AndroidVideoPlayerApiCodec() {}

@Override
protected Object readValueOfType(byte type, ByteBuffer buffer) {
Expand Down Expand Up @@ -621,40 +621,45 @@ protected void writeValue(ByteArrayOutputStream stream, Object value) {
}

/** Generated interface from Pigeon that represents a handler of messages from Flutter. */
public interface VideoPlayerApi {
public interface AndroidVideoPlayerApi {
void initialize();

TextureMessage create(CreateMessage msg);
@NonNull
TextureMessage create(@NonNull CreateMessage msg);

void dispose(TextureMessage msg);
void dispose(@NonNull TextureMessage msg);

void setLooping(LoopingMessage msg);
void setLooping(@NonNull LoopingMessage msg);

void setVolume(VolumeMessage msg);
void setVolume(@NonNull VolumeMessage msg);

void setPlaybackSpeed(PlaybackSpeedMessage msg);
void setPlaybackSpeed(@NonNull PlaybackSpeedMessage msg);

void play(TextureMessage msg);
void play(@NonNull TextureMessage msg);

PositionMessage position(TextureMessage msg);
@NonNull
PositionMessage position(@NonNull TextureMessage msg);

void seekTo(PositionMessage msg);
void seekTo(@NonNull PositionMessage msg);

void pause(TextureMessage msg);
void pause(@NonNull TextureMessage msg);

void setMixWithOthers(MixWithOthersMessage msg);
void setMixWithOthers(@NonNull MixWithOthersMessage msg);

/** The codec used by VideoPlayerApi. */
/** The codec used by AndroidVideoPlayerApi. */
static MessageCodec<Object> getCodec() {
return VideoPlayerApiCodec.INSTANCE;
return AndroidVideoPlayerApiCodec.INSTANCE;
}

/** Sets up an instance of `VideoPlayerApi` to handle messages through the `binaryMessenger`. */
static void setup(BinaryMessenger binaryMessenger, VideoPlayerApi api) {
/**
* Sets up an instance of `AndroidVideoPlayerApi` to handle messages through the
* `binaryMessenger`.
*/
static void setup(BinaryMessenger binaryMessenger, AndroidVideoPlayerApi api) {
{
BasicMessageChannel<Object> channel =
new BasicMessageChannel<>(
binaryMessenger, "dev.flutter.pigeon.VideoPlayerApi.initialize", getCodec());
binaryMessenger, "dev.flutter.pigeon.AndroidVideoPlayerApi.initialize", getCodec());
if (api != null) {
channel.setMessageHandler(
(message, reply) -> {
Expand All @@ -674,7 +679,7 @@ static void setup(BinaryMessenger binaryMessenger, VideoPlayerApi api) {
{
BasicMessageChannel<Object> channel =
new BasicMessageChannel<>(
binaryMessenger, "dev.flutter.pigeon.VideoPlayerApi.create", getCodec());
binaryMessenger, "dev.flutter.pigeon.AndroidVideoPlayerApi.create", getCodec());
if (api != null) {
channel.setMessageHandler(
(message, reply) -> {
Expand All @@ -699,7 +704,7 @@ static void setup(BinaryMessenger binaryMessenger, VideoPlayerApi api) {
{
BasicMessageChannel<Object> channel =
new BasicMessageChannel<>(
binaryMessenger, "dev.flutter.pigeon.VideoPlayerApi.dispose", getCodec());
binaryMessenger, "dev.flutter.pigeon.AndroidVideoPlayerApi.dispose", getCodec());
if (api != null) {
channel.setMessageHandler(
(message, reply) -> {
Expand All @@ -724,7 +729,7 @@ static void setup(BinaryMessenger binaryMessenger, VideoPlayerApi api) {
{
BasicMessageChannel<Object> channel =
new BasicMessageChannel<>(
binaryMessenger, "dev.flutter.pigeon.VideoPlayerApi.setLooping", getCodec());
binaryMessenger, "dev.flutter.pigeon.AndroidVideoPlayerApi.setLooping", getCodec());
if (api != null) {
channel.setMessageHandler(
(message, reply) -> {
Expand All @@ -749,7 +754,7 @@ static void setup(BinaryMessenger binaryMessenger, VideoPlayerApi api) {
{
BasicMessageChannel<Object> channel =
new BasicMessageChannel<>(
binaryMessenger, "dev.flutter.pigeon.VideoPlayerApi.setVolume", getCodec());
binaryMessenger, "dev.flutter.pigeon.AndroidVideoPlayerApi.setVolume", getCodec());
if (api != null) {
channel.setMessageHandler(
(message, reply) -> {
Expand All @@ -774,7 +779,9 @@ static void setup(BinaryMessenger binaryMessenger, VideoPlayerApi api) {
{
BasicMessageChannel<Object> channel =
new BasicMessageChannel<>(
binaryMessenger, "dev.flutter.pigeon.VideoPlayerApi.setPlaybackSpeed", getCodec());
binaryMessenger,
"dev.flutter.pigeon.AndroidVideoPlayerApi.setPlaybackSpeed",
getCodec());
if (api != null) {
channel.setMessageHandler(
(message, reply) -> {
Expand All @@ -799,7 +806,7 @@ static void setup(BinaryMessenger binaryMessenger, VideoPlayerApi api) {
{
BasicMessageChannel<Object> channel =
new BasicMessageChannel<>(
binaryMessenger, "dev.flutter.pigeon.VideoPlayerApi.play", getCodec());
binaryMessenger, "dev.flutter.pigeon.AndroidVideoPlayerApi.play", getCodec());
if (api != null) {
channel.setMessageHandler(
(message, reply) -> {
Expand All @@ -824,7 +831,7 @@ static void setup(BinaryMessenger binaryMessenger, VideoPlayerApi api) {
{
BasicMessageChannel<Object> channel =
new BasicMessageChannel<>(
binaryMessenger, "dev.flutter.pigeon.VideoPlayerApi.position", getCodec());
binaryMessenger, "dev.flutter.pigeon.AndroidVideoPlayerApi.position", getCodec());
if (api != null) {
channel.setMessageHandler(
(message, reply) -> {
Expand All @@ -849,7 +856,7 @@ static void setup(BinaryMessenger binaryMessenger, VideoPlayerApi api) {
{
BasicMessageChannel<Object> channel =
new BasicMessageChannel<>(
binaryMessenger, "dev.flutter.pigeon.VideoPlayerApi.seekTo", getCodec());
binaryMessenger, "dev.flutter.pigeon.AndroidVideoPlayerApi.seekTo", getCodec());
if (api != null) {
channel.setMessageHandler(
(message, reply) -> {
Expand All @@ -874,7 +881,7 @@ static void setup(BinaryMessenger binaryMessenger, VideoPlayerApi api) {
{
BasicMessageChannel<Object> channel =
new BasicMessageChannel<>(
binaryMessenger, "dev.flutter.pigeon.VideoPlayerApi.pause", getCodec());
binaryMessenger, "dev.flutter.pigeon.AndroidVideoPlayerApi.pause", getCodec());
if (api != null) {
channel.setMessageHandler(
(message, reply) -> {
Expand All @@ -899,7 +906,9 @@ static void setup(BinaryMessenger binaryMessenger, VideoPlayerApi api) {
{
BasicMessageChannel<Object> channel =
new BasicMessageChannel<>(
binaryMessenger, "dev.flutter.pigeon.VideoPlayerApi.setMixWithOthers", getCodec());
binaryMessenger,
"dev.flutter.pigeon.AndroidVideoPlayerApi.setMixWithOthers",
getCodec());
if (api != null) {
channel.setMessageHandler(
(message, reply) -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
import io.flutter.embedding.engine.plugins.FlutterPlugin;
import io.flutter.plugin.common.BinaryMessenger;
import io.flutter.plugin.common.EventChannel;
import io.flutter.plugins.videoplayer.Messages.AndroidVideoPlayerApi;
import io.flutter.plugins.videoplayer.Messages.CreateMessage;
import io.flutter.plugins.videoplayer.Messages.LoopingMessage;
import io.flutter.plugins.videoplayer.Messages.MixWithOthersMessage;
import io.flutter.plugins.videoplayer.Messages.PlaybackSpeedMessage;
import io.flutter.plugins.videoplayer.Messages.PositionMessage;
import io.flutter.plugins.videoplayer.Messages.TextureMessage;
import io.flutter.plugins.videoplayer.Messages.VideoPlayerApi;
import io.flutter.plugins.videoplayer.Messages.VolumeMessage;
import io.flutter.view.TextureRegistry;
import java.security.KeyManagementException;
Expand All @@ -27,7 +27,7 @@
import javax.net.ssl.HttpsURLConnection;

/** Android platform implementation of the VideoPlayerPlugin. */
public class VideoPlayerPlugin implements FlutterPlugin, VideoPlayerApi {
public class VideoPlayerPlugin implements FlutterPlugin, AndroidVideoPlayerApi {
private static final String TAG = "VideoPlayerPlugin";
private final LongSparseArray<VideoPlayer> videoPlayers = new LongSparseArray<>();
private FlutterState flutterState;
Expand Down Expand Up @@ -61,7 +61,6 @@ public static void registerWith(io.flutter.plugin.common.PluginRegistry.Registra

@Override
public void onAttachedToEngine(FlutterPluginBinding binding) {

if (android.os.Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
try {
HttpsURLConnection.setDefaultSSLSocketFactory(new CustomSSLSocketFactory());
Expand Down Expand Up @@ -241,11 +240,11 @@ private static final class FlutterState {
}

void startListening(VideoPlayerPlugin methodCallHandler, BinaryMessenger messenger) {
VideoPlayerApi.setup(messenger, methodCallHandler);
AndroidVideoPlayerApi.setup(messenger, methodCallHandler);
}

void stopListening(BinaryMessenger messenger) {
VideoPlayerApi.setup(messenger, null);
AndroidVideoPlayerApi.setup(messenger, null);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import 'messages.g.dart';
/// An Android implementation of [VideoPlayerPlatform] that uses the
/// Pigeon-generated [VideoPlayerApi].
class AndroidVideoPlayer extends VideoPlayerPlatform {
final VideoPlayerApi _api = VideoPlayerApi();
final AndroidVideoPlayerApi _api = AndroidVideoPlayerApi();

/// Registers this class as the default instance of [PathProviderPlatform].
static void registerWith() {
Expand Down
Loading