Skip to content

Commit

Permalink
fix web build
Browse files Browse the repository at this point in the history
  • Loading branch information
julienbm committed Nov 26, 2024
1 parent ad3efa4 commit 6bcc281
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/src/controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ import 'dart:typed_data';
import 'package:video_player/video_player.dart';
import 'package:video_player_platform_interface/video_player_platform_interface.dart';

import 'media_info.dart';
import 'media_info.dart'
if (dart.library.js_interop) 'media_info_dummy.dart'
if (dart.library.html) 'media_info_dummy.dart';
import 'video_player_mdk.dart'
if (dart.library.js_interop) 'video_player_dummy.dart'
if (dart.library.html) 'video_player_dummy.dart';
Expand Down
4 changes: 4 additions & 0 deletions lib/src/media_info_dummy.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/// A dummy class for web
class MediaInfo {

}
17 changes: 17 additions & 0 deletions lib/src/video_player_dummy.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import 'dart:typed_data';

import 'media_info_dummy.dart';

/// A dummy class for web
class MdkVideoPlayerPlatform {
static void registerVideoPlayerPlatformsWith({dynamic options}) {}
Expand All @@ -9,6 +11,8 @@ class MdkVideoPlayerPlatform {
return false;
}

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

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

void setAudioDecoders(int textureId, List<String> value) {}
Expand Down Expand Up @@ -37,12 +41,25 @@ class MdkVideoPlayerPlatform {
void setHue(int textureId, double value) {}

void setSaturation(int textureId, double value) {}

void setAudioTracks(int textureId, List<int> value) {}

List<int>? getActiveAudioTracks(int textureId) {
return null;
}

void setVideoTracks(int textureId, List<int> value) {}

List<int>? getActiveVideoTracks(int textureId) {
return null;
}

void setSubtitleTracks(int textureId, List<int> value) {}

List<int>? getActiveSubtitleTracks(int textureId) {
return null;
}

void setExternalAudio(int textureId, String uri) {}

void setExternalVideo(int textureId, String uri) {}
Expand Down

0 comments on commit 6bcc281

Please sign in to comment.