Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor!: improve separation of global audioplayer interface #1443

Merged
merged 3 commits into from
Mar 20, 2023

Conversation

Gustl22
Copy link
Collaborator

@Gustl22 Gustl22 commented Mar 18, 2023

Description

AudioPlayers platform communication consists of two parts: the AudioPlayer scope and the Global scope.
These were not separated consistently, so one was used as implementation and the other as interface.
Now both scopes are handled the same way:

  • AudioPlayer: player specific processing and interaction via AudioplayersPlatformInterface
  • GlobalAudioScope: global processing and interaction via GlobalAudioplayersPlatformInterface
  • AudioplayersPlatformInterface: interface to player platform channel (methods and events), holds an instance implementation like AudioplayersPlatform or WebAudioplayersPlatform
  • GlobalAudioplayersPlatformInterface: interface to global platform channel (methods and events), holds an instance implementation like GlobalAudioplayersPlatform or WebGlobalAudioplayersPlatform
  • AudioplayersPlatform: platform channel implementation of AudioplayersPlatformInterface
  • GlobalAudioplayersPlatform: platform channel implementation of GlobalAudioplayersPlatformInterface

Also deprecated AudioPlayer.global.setGlobalAudioContext() in favor of AudioPlayer.global.setAudioContext() as the method is called on the global scope anyways and other methods don't have the global keyword in it.

Checklist

  • The title of my PR starts with a [Conventional Commit] prefix (fix:, feat:, docs:, chore: etc).
  • I have read the [Contributor Guide] and followed the process outlined for submitting PRs.
  • I have updated/added tests for ALL new/updated/fixed functionality.
  • I have updated/added relevant documentation and added dartdoc comments with ///, where necessary.
  • I have updated/added relevant examples in [example].

Breaking Change

  • Yes, this is a breaking change.
  • No, this is not a breaking change.

Migration instructions

audioplayers:

Before After
GlobalPlatformInterface GlobalAudioScope
AudioPlayer.global.setGlobalAudioContext() AudioPlayer.global.setAudioContext()

audioplayers_platform_interface:

Before After
AudioplayersPlatform AudioplayersPlatformInterface
MethodChannelAudioplayersPlatform AudioplayersPlatform
GlobalPlatformInterface GlobalAudioplayersPlatformInterface
MethodChannelGlobalPlatform GlobalAudioplayersPlatform

audioplayers_web:

Before After
AudioplayersPlugin AudioplayersPlugin, WebAudioplayersPlatform and WebGlobalAudioplayersPlatform

Related Issues

#1352

@Gustl22 Gustl22 requested review from luanpotter and spydon March 18, 2023 21:50
@Gustl22 Gustl22 changed the title feat!: improve separation of global audioplayer interface refactor!: improve separation of global audioplayer interface Mar 20, 2023
@Gustl22 Gustl22 enabled auto-merge (squash) March 20, 2023 14:36
@Gustl22 Gustl22 merged commit c0b3f85 into main Mar 20, 2023
@Gustl22 Gustl22 deleted the gustl22/adapt-platform-interface branch March 20, 2023 14:37
Gustl22 added a commit that referenced this pull request Aug 16, 2023
# Description

Closes #1453.

### Migration instructions

See #1352 and #1443
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants