Skip to content

Commit

Permalink
fix warnings, format
Browse files Browse the repository at this point in the history
flutter analyze lib/src/player.dart: Color.red is deprecated, remove
  • Loading branch information
wang-bin committed Dec 13, 2024
1 parent e155062 commit 5b44ceb
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 15 deletions.
2 changes: 1 addition & 1 deletion lib/fvp.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import 'src/video_player_mdk.dart'

export 'src/controller.dart';

/// Registers this plugin as the default instance of [VideoPlayerPlatform]. Then your [VideoPlayer] will support all platforms.
/// Registers this plugin as the default instance of VideoPlayerPlatform. Then your [VideoPlayer] will support all platforms.
/// If registerWith is not called, the previous(usually official) implementation will be used when available.
/// [options] can be
Expand Down
2 changes: 1 addition & 1 deletion lib/src/controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ extension FVPControllerExtensions on VideoPlayerController {
}

/// Step forward or backward.
/// Step forward if [frame] > 0, backward otherwise.
/// Step forward if [frames] > 0, backward otherwise.
Future<void> step({int frames = 1}) async {
return _platform.step(textureId, frames);
}
Expand Down
4 changes: 1 addition & 3 deletions lib/src/media_info_dummy.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
/// A dummy class for web
class MediaInfo {

}
class MediaInfo {}
9 changes: 1 addition & 8 deletions lib/src/player.dart
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ class Player {

/// Release current texture then create a new one for current [media], and update [textureId].
///
/// Texture will be created when media is loaded and [mediaInfo.video] is not empty.
/// Texture will be created when media is loaded and mediaInfo.video is not empty.
/// If both [width] and [height] are null, texture size is video frame size, otherwise is requested size.
Future<int> updateTexture(
{int? width, int? height, bool? tunnel, bool? fit}) async {
Expand Down Expand Up @@ -615,13 +615,6 @@ class Player {
Pointer<Void>)>()(
_player.ref.object, r, g, b, a, Pointer.fromAddress(0));

/// Set background color.
/// https://github.com/wang-bin/mdk-sdk/wiki/Player-APIs#void-setbackgroundcolorfloat-r-float-g-float-b-float-a-void-vo_opaque--nullptr
void setBackground(ui.Color c) => _player.ref.setBackgroundColor.asFunction<
void Function(Pointer<mdkPlayer>, double, double, double, double,
Pointer<Void>)>()(_player.ref.object, c.red / 255, c.green / 255,
c.blue / 255, c.alpha / 255, Pointer.fromAddress(0));

/// Set a built-in video effect.
/// https://github.com/wang-bin/mdk-sdk/wiki/Player-APIs#player-setvideoeffect-effect-const-float-values-void-vo_opaque--nullptr
void setVideoEffect(VideoEffect effect, List<double> value) {
Expand Down
4 changes: 3 additions & 1 deletion lib/src/video_player_dummy.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ class MdkVideoPlayerPlatform {
return false;
}

MediaInfo? getMediaInfo(int textureId) { return null; }
MediaInfo? getMediaInfo(int textureId) {
return null;
}

void setProperty(int textureId, String name, String value) {}

Expand Down
1 change: 0 additions & 1 deletion lib/src/video_player_mdk.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import 'media_info.dart';

import '../mdk.dart' as mdk;


final _log = Logger('fvp');

class MdkVideoPlayer extends mdk.Player {
Expand Down

0 comments on commit 5b44ceb

Please sign in to comment.