Skip to content

Commit

Permalink
fix: ci issues
Browse files Browse the repository at this point in the history
  • Loading branch information
peilinok committed Feb 8, 2025
1 parent c80ae2f commit 38f12f8
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// ignore_for_file: avoid_print

import 'dart:ffi';
import 'dart:io';
import 'package:agora_rtc_engine/agora_rtc_engine.dart';
import 'package:agora_rtc_engine_example/config/agora.config.dart' as config;
Expand Down Expand Up @@ -255,8 +254,8 @@ class _State extends State<PictureInPicture> with WidgetsBindingObserver {
await _engine.enableVideo();
await _engine.startPreview();

var isPipSupported = await _engine.isPipSupported();
var isPipAutoEnterSupported = await _engine.isPipAutoEnterSupported();
var isPipSupported = await _engine.pipIsSupported();
var isPipAutoEnterSupported = await _engine.pipIsAutoEnterSupported();

setState(() {
_isPipSupported = isPipSupported;
Expand Down
14 changes: 5 additions & 9 deletions lib/src/agora_rtc_engine_ext.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,11 @@ import 'package:agora_rtc_engine/src/agora_media_player.dart';
import 'package:agora_rtc_engine/src/agora_rtc_engine.dart';
import 'package:agora_rtc_engine/src/agora_rtc_engine_ex.dart';
import 'package:agora_rtc_engine/src/impl/agora_rtc_engine_impl.dart';
import 'package:agora_rtc_engine/src/agora_base.dart';
import 'package:flutter/foundation.dart';
import 'agora_base.dart';
import 'impl/agora_rtc_engine_impl.dart' as impl;
import 'impl/media_player_impl.dart';

export 'dart:convert';
export 'dart:typed_data';
export 'package:json_annotation/json_annotation.dart';

/// @nodoc
class AgoraPipOptions {
/// @nodoc
Expand Down Expand Up @@ -158,18 +154,18 @@ extension RtcEngineExt on RtcEngine {
///
/// Returns
/// Whether Picture in Picture is supported.
Future<bool> isPipSupported() async {
Future<bool> pipIsSupported() async {
final impl = this as RtcEngineImpl;
return impl.isPipSupported();
return impl.pipIsSupported();
}

/// Check if Picture in Picture can auto enter.
///
/// Returns
/// Whether Picture in Picture can auto enter.
Future<bool> isPipAutoEnterSupported() async {
Future<bool> pipIsAutoEnterSupported() async {
final impl = this as RtcEngineImpl;
return impl.isPipAutoEnterSupported();
return impl.pipIsAutoEnterSupported();
}

/// Check if Picture in Picture is active.
Expand Down
7 changes: 4 additions & 3 deletions lib/src/impl/agora_rtc_engine_impl.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import 'dart:async';
import 'dart:convert';
import 'dart:typed_data';

import 'package:agora_rtc_engine/src/agora_base.dart';
import 'package:agora_rtc_engine/src/agora_h265_transcoder.dart';
Expand Down Expand Up @@ -1060,14 +1062,13 @@ class RtcEngineImpl extends rtc_engine_ex_binding.RtcEngineExImpl
_pipStateChangedObserver = null;
}

@override
Future<bool> isPipSupported() async {
Future<bool> pipIsSupported() async {
final result =
await engineMethodChannel.invokeMethod<bool>('pipIsSupported', null);
return result ?? false;
}

Future<bool> isPipAutoEnterSupported() async {
Future<bool> pipIsAutoEnterSupported() async {
final result = await engineMethodChannel.invokeMethod<bool>(
'pipIsAutoEnterSupported', null);
return result ?? false;
Expand Down
12 changes: 12 additions & 0 deletions lib/src/impl/video_view_controller_impl.dart
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,11 @@ mixin VideoViewControllerBaseMixin implements VideoViewControllerBase {
}

/// Implementation of [PIPVideoViewController]
@Deprecated('This class is deprecated')
class PIPVideoViewControllerImpl extends VideoViewController
implements PIPVideoViewController {
/// @nodoc
@Deprecated('This constructor is deprecated')
// ignore: use_super_parameters
PIPVideoViewControllerImpl(
{required RtcEngine rtcEngine,
Expand All @@ -172,6 +174,7 @@ class PIPVideoViewControllerImpl extends VideoViewController
);

/// @nodoc
@Deprecated('This constructor is deprecated')
// ignore: use_super_parameters
PIPVideoViewControllerImpl.remote(
{required RtcEngine rtcEngine,
Expand All @@ -192,6 +195,7 @@ class PIPVideoViewControllerImpl extends VideoViewController
bool _isDisposedRender = false;

@override
@Deprecated('This method is deprecated')
Future<void> setupView(int nativeViewPtr) async {
await super.setupView(nativeViewPtr);

Expand All @@ -201,6 +205,7 @@ class PIPVideoViewControllerImpl extends VideoViewController
}

@override
@Deprecated('This method is deprecated')
Future<void> disposeRender() async {
_isDisposedRender = true;
_nativeViewPtr = 0;
Expand All @@ -209,17 +214,20 @@ class PIPVideoViewControllerImpl extends VideoViewController
}

@override
@Deprecated('This method is deprecated')
Future<void> dispose() async {
await stopPictureInPicture();
await destroyPictureInPicture();
}

@override
@Deprecated('This method is deprecated')
Future<bool> isPipSupported() {
return rtcEngine.isPipSupported();
}

@override
@Deprecated('This method is deprecated')
Future<void> destroyPictureInPicture() async {
// On android, there's no stop pip function
if (defaultTargetPlatform == TargetPlatform.iOS) {
Expand All @@ -235,6 +243,7 @@ class PIPVideoViewControllerImpl extends VideoViewController
}

@override
@Deprecated('This method is deprecated')
Future<void> setupPictureInPicture(PipOptions options) async {
assert(!kIsWeb, 'PIP feature is not supported on web.');
assert(
Expand Down Expand Up @@ -278,6 +287,7 @@ class PIPVideoViewControllerImpl extends VideoViewController
}

@override
@Deprecated('This method is deprecated')
Future<void> startPictureInPicture() async {
if (_isDisposedRender) {
return;
Expand All @@ -287,6 +297,7 @@ class PIPVideoViewControllerImpl extends VideoViewController
}

@override
@Deprecated('This method is deprecated')
Future<void> stopPictureInPicture() async {
// On android, there's no stop pip function
if (defaultTargetPlatform == TargetPlatform.iOS) {
Expand All @@ -295,5 +306,6 @@ class PIPVideoViewControllerImpl extends VideoViewController
}

@override
@Deprecated('This getter is deprecated')
bool get isInPictureInPictureMode => _isPipSetuped;
}
9 changes: 9 additions & 0 deletions lib/src/render/video_view_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,10 @@ class VideoViewController
}

/// @nodoc
@Deprecated('This class is deprecated')
abstract class PIPVideoViewController extends VideoViewControllerBase {
/// @nodoc
@Deprecated('This factory is deprecated')
factory PIPVideoViewController(
{required RtcEngine rtcEngine,
required VideoCanvas canvas,
Expand All @@ -120,6 +122,7 @@ abstract class PIPVideoViewController extends VideoViewControllerBase {
);

/// @nodoc
@Deprecated('This factory is deprecated')
factory PIPVideoViewController.remote(
{required RtcEngine rtcEngine,
required VideoCanvas canvas,
Expand All @@ -133,20 +136,26 @@ abstract class PIPVideoViewController extends VideoViewControllerBase {
);

/// @nodoc
@Deprecated('This method is deprecated')
Future<bool> isPipSupported();

/// @nodoc
@Deprecated('This method is deprecated')
Future<void> setupPictureInPicture(PipOptions options);

/// @nodoc
@Deprecated('This method is deprecated')
Future<void> destroyPictureInPicture();

/// @nodoc
@Deprecated('This method is deprecated')
Future<void> startPictureInPicture();

/// @nodoc
@Deprecated('This method is deprecated')
Future<void> stopPictureInPicture();

/// @nodoc
@Deprecated('This getter is deprecated')
bool get isInPictureInPictureMode;
}

0 comments on commit 38f12f8

Please sign in to comment.