ArturSierzant / OMPD

O!MPD is free, opensource MPD client based on PHP and mySQL.
http://ompd.pl
GNU General Public License v3.0
40 stars 13 forks source link

external mobile phone browser acess to streams #151

Open surtarso opened 2 years ago

surtarso commented 2 years ago

Hi there, really like your work! thanks for this! I've been having trouble playing outside my home network. It's not a connection/configuration problem I'd say, since I can connect to the ompd page, log in, download albums etc while outside my home network... but I can't seem to stream.. I can open m3u streams normally with VLC on desktops but not on mobile... it just defaults to the browser player... and the odd thing is that the mobile browser players is able to play while im in my LAN, but not on mobile networks (4g) so when im outside my lan and on phone I cant send the link to VLC (coping, saving etc doesnt work for some reason...) and it also defaults to browser player giving the MIME type error... Is there (or plans) on some kind of mobile app or browser extension, yours or outside, that will play the album? I noticed on my wife's iphone using safari it worked flawlessly on browser play btw (both LAN and mobile) I'm having a hard time figuring out where should I taclke... is that OMPD unable to do something? or my server config? or browser phones go brrr? Other than that, thanks again! beautiful work.

ArturSierzant commented 2 years ago

Hi, I don't know why it doesn't work and unfortunately I can't reproduce this on my own (have no access to my LAN from Internet). So it works in Safari browser on iphone, but doesn't work on yours (Android, I guess)? MIME type for file is taken from its tag simply called mime_type and is stored in DB table track. I would start from checking this first - are they correctly written?

surtarso commented 2 years ago

Ok, MIME types seem correct. On my desktop pc, If I click "stream", it will pop-up a message asking me to save or open an .m3u file (expected behavior)

On mobile phones, if I click "stream" it tries to open the stream on browser (chrome, opera and firefox) and gives me a mime_type error (safari works) BUT if I hold stream to get save options, it saves an .HTM file instead of .m3u and I cant open it with VLC(mobile), so pretty much theres no way to stream on mobile?

That behavior is for both LAN and and outside LAN thru https

What most people seem to be doing about this is adding an MPD to their mobile and directing it to OMPD as a player. Not sure thats the way it is intended to be used...

ArturSierzant commented 2 years ago

I took a deeper look at streaming on Android and indeed it doesn't work how it supposed to. There is old but still not closed issue about m3u files with html streams on Android IssueTracker (https://issuetracker.google.com/issues/36915401) - is it possible that this is still a problem on Android?

Maybe implementing HTML5 player would solve the issue. For now I found a solution that work in my case (Android 11, Chrome browser, playing in LAN):

  1. after clicking on 'Stream album' I save m3u file: obraz

  2. after file is downloaded I open it: obraz

  3. file is opened in (Chrome?) internal player, but nothing is happening: obraz

  4. so I click share symbol at the top of screen and choose VLC to finish action: obraz

  5. playback starts in the background. Then when I open (or switch to) VLC I see whole album loaded into playlist: obraz

To be honest I don't use 'Stream album' (or file) on Android - I installed MPD on my moble, added it to O!MPD players list and use O!MPD to control it, as you mentioned.

Unfortunately I can't test it outside of my LAN - I don't have access to it from Internet.