Skip to content

Commit

Permalink
Add setWebCrossOrigin to just_audio_background.
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanheise committed May 18, 2024
1 parent 3656454 commit 6e36ce4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
4 changes: 4 additions & 0 deletions just_audio_background/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.0.1-beta.12

* Support setWebCrossOrigin.

## 0.0.1-beta.11

* Pass through missing API methods.
Expand Down
12 changes: 12 additions & 0 deletions just_audio_background/lib/just_audio_background.dart
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,13 @@ class _JustAudioPlayer extends AudioPlayerPlatform {
SetShuffleOrderRequest request) =>
_playerAudioHandler.customSetShuffleOrder(request);

@override
Future<SetWebCrossOriginResponse> setWebCrossOrigin(
SetWebCrossOriginRequest request) async {
_playerAudioHandler.customSetWebCrossOrigin(request);
return SetWebCrossOriginResponse();
}

@override
Future<SeekResponse> seek(SeekRequest request) =>
_playerAudioHandler.customPlayerSeek(request);
Expand Down Expand Up @@ -507,6 +514,11 @@ class _PlayerAudioHandler extends BaseAudioHandler
));
}

Future<SetWebCrossOriginResponse> customSetWebCrossOrigin(
SetWebCrossOriginRequest request) async {
return await (await _player).setWebCrossOrigin(request);
}

Future<ConcatenatingInsertAllResponse> customConcatenatingInsertAll(
ConcatenatingInsertAllRequest request) async {
final cat = _source!.findCat(request.id)!;
Expand Down

0 comments on commit 6e36ce4

Please sign in to comment.