Skip to content

Commit

Permalink
Fill API gaps
Browse files Browse the repository at this point in the history
  • Loading branch information
hawk23 committed Nov 21, 2024
1 parent 10704b1 commit 83e495d
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 15 deletions.
15 changes: 15 additions & 0 deletions lib/src/platform/web/bitmovin_player_web_api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,21 @@ class BitmovinPlayerJs {
external void mute();
external void unmute();
external void load(SourceJs source);
external void seek(double time);
external void timeShift(double offset);
external double getTimeShift();
external void destroy();
external void castVideo();
external void castStop();
external bool isPlaying();
external bool isLive();
external bool isCasting();
external bool isCastAvailable();
external bool isAirplayActive();
external bool isAirplayAvailable();
external double getCurrentTime();
external double getDuration();
external double getMaxTimeShift();
}

@JS()
Expand Down
30 changes: 15 additions & 15 deletions lib/src/platform/web/player_platform_web.dart
Original file line number Diff line number Diff line change
Expand Up @@ -50,34 +50,34 @@ class PlayerPlatformWeb extends PlayerPlatformInterface {
throw UnimplementedError();

@override
Future<void> castStop() async => throw UnimplementedError();
Future<void> castStop() async => _player.castStop();

@override
Future<void> castVideo() async => throw UnimplementedError();
Future<void> castVideo() async => _player.castVideo();

@override
Future<double> get currentTime async => throw UnimplementedError();
Future<double> get currentTime async => _player.getCurrentTime();

@override
Future<double> get duration async => throw UnimplementedError();
Future<double> get duration async => _player.getDuration();

@override
Future<bool> get isAirPlayActive async => throw UnimplementedError();
Future<bool> get isAirPlayActive async => _player.isAirplayActive();

@override
Future<bool> get isAirPlayAvailable async => throw UnimplementedError();
Future<bool> get isAirPlayAvailable async => _player.isAirplayAvailable();

@override
Future<bool> get isCastAvailable async => throw UnimplementedError();
Future<bool> get isCastAvailable async => _player.isCastAvailable();

@override
Future<bool> get isCasting async => throw UnimplementedError();
Future<bool> get isCasting async => _player.isCasting();

@override
Future<bool> get isLive async => throw UnimplementedError();
Future<bool> get isLive async => _player.isLive();

@override
Future<bool> get isPlaying async => throw UnimplementedError();
Future<bool> get isPlaying async => _player.isPlaying();

@override
Future<void> loadSource(Source source) async {
Expand All @@ -86,7 +86,7 @@ class PlayerPlatformWeb extends PlayerPlatformInterface {
}

@override
Future<double> get maxTimeShift async => throw UnimplementedError();
Future<double> get maxTimeShift async => _player.getMaxTimeShift();

@override
Future<void> mute() async => _player.mute();
Expand All @@ -101,14 +101,14 @@ class PlayerPlatformWeb extends PlayerPlatformInterface {
Future<void> removeSubtitle(String id) async => throw UnimplementedError();

@override
Future<void> seek(double time) async => throw UnimplementedError();
Future<void> seek(double time) async => _player.seek(time);

@override
Future<void> setSubtitle(String? id) async => throw UnimplementedError();

@override
Future<void> setTimeShift(double timeShift) async =>
throw UnimplementedError();
_player.timeShift(timeShift);

@override
Future<void> showAirPlayTargetPicker() async => throw UnimplementedError();
Expand All @@ -117,13 +117,13 @@ class PlayerPlatformWeb extends PlayerPlatformInterface {
Future<SubtitleTrack> get subtitle async => throw UnimplementedError();

@override
Future<double> get timeShift async => throw UnimplementedError();
Future<double> get timeShift async => _player.getTimeShift();

@override
Future<void> unmute() async => _player.unmute();

@override
Future<void> dispose() async => throw UnimplementedError();
Future<void> dispose() async => _player.destroy();

@override
Future<void> sendCustomDataEvent(CustomData customData) async =>
Expand Down

0 comments on commit 83e495d

Please sign in to comment.