Fix: can't play media files from file browser
When media file is selected from various file browers, the uri sent to app might be different scheme like file or content. Fix is to query the media file based on different scheme.
This commit is contained in:
parent
d5bf0b58d2
commit
11584bdab6
2 changed files with 38 additions and 9 deletions
|
|
@ -46,7 +46,6 @@ import com.kabouzeid.gramophone.util.PreferenceUtil;
|
|||
import com.kabouzeid.gramophone.util.Util;
|
||||
import com.sothree.slidinguppanel.SlidingUpPanelLayout;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import butterknife.BindView;
|
||||
|
|
@ -299,7 +298,7 @@ public class MainActivity extends AbsSlidingMusicPanelActivity {
|
|||
}
|
||||
|
||||
if (uri != null && uri.toString().length() > 0) {
|
||||
MusicPlayerRemote.playFile(new File(uri.getPath()).getAbsolutePath());
|
||||
MusicPlayerRemote.playFromUri(uri);
|
||||
handled = true;
|
||||
} else if (MediaStore.Audio.Playlists.CONTENT_TYPE.equals(mimeType)) {
|
||||
final int id = (int) parseIdFromIntent(intent, "playlistId", "playlist");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue