Hello,
Welcome to our Microsoft Q&A platform!
If you want to have an UI and play next audio automatically. You can use install
Plugin.MediaManager.Forms
as well.
First of all, here running UI.
Here is UI in the notification task.
Here is xaml code.
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:mm="clr-namespace:MediaManager.Forms;assembly=MediaManager.Forms"
x:Class="App13.MainPage">
<StackLayout>
<mm:VideoView VerticalOptions="FillAndExpand" AutoPlay="True" ShowControls="True" x:Name="MyVidem" />
</StackLayout>
</ContentPage>
Here is background code for list music
public partial class MainPage : ContentPage
{
public MainPage()
{
InitializeComponent();
playmusic();
}
public IList<string> Mp3UrlList => new[]{
"https://ia800806.us.archive.org/15/items/Mp3Playlist_555/AaronNeville-CrazyLove.mp3",
"https://ia800605.us.archive.org/32/items/Mp3Playlist_555/CelineDion-IfICould.mp3",
"https://ia800605.us.archive.org/32/items/Mp3Playlist_555/Daughtry-Homeacoustic.mp3",
"https://storage.googleapis.com/uamp/The_Kyoto_Connection_-_Wake_Up/01_-_Intro_-_The_Way_Of_Waking_Up_feat_Alan_Watts.mp3",
"https://aphid.fireside.fm/d/1437767933/02d84890-e58d-43eb-ab4c-26bcc8524289/d9b38b7f-5ede-4ca7-a5d6-a18d5605aba1.mp3"
};
private async void playmusic()
{
// throw new NotImplementedException();
await CrossMediaManager.Current.Play(Mp3UrlList);
}
Best Regards,
Leon Lu
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
Please Call
CrossMediaManager.Current.Init(this);
in theOnCreate
method.And set targetFramework to Android 10.0 or later.
What is the target and min android versions we need to set here?
I am getting an error after changing the targetFramework to Android 10.0.
targetFramework to Android 10.0 or later like following screenshot.
target and min android versions: That is by your needs. I set
No Dex compiler was specified, select D8 Dex compiler in the Android project properties like this thread:
https://stackoverflow.com/questions/57027952/xamarin-build-error-defining-a-default-interface-method-requires-min-sdk-vers
Getting a new message on output box and app is breaking after launching.
The type initializer for 'IMediaDescriptionAdapter' threw an exception.
=================================================================
Native Crash Reporting
Got a SIGSEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
No native Android stacktrace (see debuggerd output).
=================================================================
Basic Fault Address Reporting
Memory around native instruction pointer (0x747a95e0e8):0x747a95e0d8 12-18 17:47:56.472 E/mono-rt (11622): /proc/self/maps:
Could you provide an demo about this?
I will create a demo and share it with you ASAP.
I have a list of audios. I need to play it one by one. If I tap an item from the list I need to play that audio. At the same time, I need to change the background color of the item. I have added a video here: https://drive.google.com/file/d/14iGg3Ubs2zbcFPLjvfPssFNH1vbC6PkN/view?usp=sharing
Is it possible to do these things using the
Plugin.MediaManager.Forms
?Yes, it could be achieved, you can refer to this thread:https://theconfuzedsourcecode.wordpress.com/2020/06/28/playing-audio-with-the-mediamanager-plugin-for-xamarin-forms/ And please keep one thread for one question, If you have other qustions ,please open an new thread for this issue.
I have uploaded a sample project here: https://drive.google.com/file/d/1oUD5U_YlY0cGj2pEoQOAPsOjdYmFfzAU/view?usp=sharing
Checked on windows and android and there are some issues. Didn't check on ios.
I used your demo, I update nuget package, it could running normally in Google Pixel, Here is your editted demo https://drive.google.com/file/d/1OSlHBewkXmRPz0-FkZOZ5fXSYf-cvR0N/view?usp=sharing
Which package you have updated? I have checked the demo you have shared, it is breaking in android and uwp with the same issues.
I update xamarin.Essentials to 1.5.3.2 and xamarin.forms version to 4.8.0.1821. Here is my nuget package's version.
, my Vistual Studio version is 16.8.3
Give me some time, I need to update my VS.
@Leon Lu (Shanghai Wicresoft Co,.Ltd.) Updated VS and it is now working in android. In windows same issue happening again.
Any change in the windows platform?
I got the same issue in UWP, and I found
list, Here are no UWP, you can open an issue in this plugin's github thread:
https://github.com/Baseflow/XamarinMediaManager/issues
In ios also it is working fine. I will report the issue on GitHub, Thanks
Reported this issue to GitHub: https://github.com/Baseflow/XamarinMediaManager/issues/777
Sign in to comment
0 additional answers
Sort by: Most helpful
Activity