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

Isue with Song.FromURI Android #3935

Open
Mattlekim opened this issue Jun 15, 2015 · 1 comment
Open

Isue with Song.FromURI Android #3935

Mattlekim opened this issue Jun 15, 2015 · 1 comment
Labels
Android Android platform

Comments

@Mattlekim
Copy link

The way Song.FromUri works on andoird is wrong.

For example
Song.FromUri("Menu Track 1", new Uri("Content/Audio/Music/MENU.mp3", UriKind.Relative)

The above code is how it should work but the name is been used to locate the file and not the uri so this is the workaround

Song.FromUri("Content/Audio/Music/MENU.mp3", new Uri("Content/Audio/Music/MENU.mp3", UriKind.Relative)

@Nezz
Copy link
Member

Nezz commented Jun 16, 2015

This is a general problem in the current implementation:

  1. FromUri calls the constructor with the file name as a parameter https://github.com/mono/MonoGame/blob/develop/MonoGame.Framework/Media/Song.cs#L77
  2. The constructor sets _name to the file name https://github.com/mono/MonoGame/blob/develop/MonoGame.Framework/Media/Song.cs#L58
  3. After the constructor return FromUri overwrites _name with the provided name https://github.com/mono/MonoGame/blob/develop/MonoGame.Framework/Media/Song.cs#L78

@Jjagg Jjagg added the Android Android platform label Dec 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Android Android platform
Projects
None yet
Development

No branches or pull requests

3 participants