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

Enable playing audio from a URL #13

Open
jfversluis opened this issue Aug 19, 2022 · 3 comments
Open

Enable playing audio from a URL #13

jfversluis opened this issue Aug 19, 2022 · 3 comments
Labels
enhancement New feature or request

Comments

@jfversluis
Copy link
Owner

No description provided.

@jfversluis jfversluis changed the title Enabled playing audio from a URL Enable playing audio from a URL Aug 19, 2022
@Mephisztoe
Copy link

Just a couple of notes regarding this request.

  1. AVAudioPlayer on iOS does not support streaming audio. So that the library can stream audio from a URL, AVAudioPlayer needs to be replaced by AVPlayer.
  2. AVPlayer does not natively support a couple of properties needed by IAudioPlayer (such as Panning, Positioning, Seeking and Looping). Other means need to be found to implement these.
  3. So that background streaming works on iOS, Background Modes need to be enabled for Audio and the MauiAppBuilder needs to catch the iOS FinishedLaunching LifeCycle event to configure the AVAudioSession as a Shared Instance for playback.
  4. The concrete player classes need to be refactored, because currently, they allow streams (files) and filenames (as strings) for construction. However, URLs are basically strings as well. Although you could inject Uris instead, you would need to extract their strings from within the players anyway, because they may have their own Uri implementation. Better is to provide static factory methods for creating AudioPlayer instances based on either filestreams, filenames or URLs.

@Mephisztoe
Copy link

Here's something, I stumbled across lately:
When using Android.Media.MediaPlayer natively and implementing a streaming feature using the approach presented in this repo, you might run into issues with (un-) supported content provider. In other words: AAC+ (aacp) might not be supported. I am currently in the process of building an online radio player app. The radio station offers different stream qualities such as 128kbps and 64kbps via Mpeg Layer 3 and 24kbps via AAC+. Although Googles' documentation claims that MediaPlayer does support AAC+, we are getting "java.io.FileNotFoundException: No content provider" exceptions.
Prior to this we used the ExoPlayer library on Android which works flawlessly. Looking at its sources, I can tell that it includes dedicated native AAC+ code.

@jfversluis jfversluis added the enhancement New feature or request label Feb 20, 2023
@FarazXTS
Copy link

FarazXTS commented Nov 29, 2023

This fork was created for this:
https://github.com/BlueSkyInnovations/Plugin.Maui.StreamingAudio/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants