Page 1 of 1
VLC launch from browser with m3u or with any media link?
Posted: 17 Dec 2018 07:16
by realjobe
Dear VLC forum.
Using pure Android 8.1 oreo and VLC 3.0.13, revision 387f303ba (ARMv8)
With what mechanism may VLC player be launched in Android world? Windows 10 desktop is just awesome on this matter. Even blobs as a href works beautiful in FireFox... Edge not.
I have tested quite many and they does not seems to work at all.
<a href="play.m3u"> just opens browser's open odd player, not VLC.
<a href="vlc://IPAddress.com/video.ts"> opens VLC but it fails saying that stream can not be opened.. Well, I guess App does understand to use HTTP to start to pull?
< href="IPAddress.com/video.ts"> just makes the browser to start downloading the file...
Altgough, iOS platform seems to understand vlc:// URI scheme..
Thank you
Re: VLC launch from browser with m3u or with any media link?
Posted: 17 Dec 2018 16:50
by unidan
Hi,
In VLC, the only solution at the native level is the Intent system:
https://developer.android.com/reference ... ent/Intent
You have solutions like
https://developer.chrome.com/multidevic ... id/intents but it might not be portable across browsers.
Your only sane solution is to let the browser do its job and send the correct intent based on the file format registered by android. It will probably download the file first. Then, if android doesn't ask you to open it with VLC, it is either a missing format to report to VLC developer or a default application that you have configured for.
Re: VLC launch from browser with m3u or with any media link?
Posted: 17 Dec 2018 17:40
by realjobe
Hi, thank you for answering.
Well, I guess the URI registration would be the way to go and it actually seems to work, because vlc:// scheme is registered to vlc's one activity, though the actualy stream pulling seems to have an issue.. iOS Safari works perfectly with this: vlc is launched stream starts to play.
I guess the vlc://ip/stream.ts is interperted somewhat faulty now because I guess http:// is not added to the url to pull, but vlc:// remains there..
Needs to be replaced before giving it to the App's engine..
Re: VLC launch from browser with m3u or with any media link?
Posted: 18 Dec 2018 09:05
by realjobe
I guess the correct place to start debugging
Code: Select all
vlc-android-master/vlc-android/src/org/videolan/vlc/StartActivity.java
is startPlaybackFromApp()
There is call to
Code: Select all
MediaUtils.INSTANCE.openMediaNoUi(intent.getData());
where the MediaUtils takes care of the getQueryParameter() to get the payload from url..
So ease way to test this is to create local/web hosted html file with <a href="vlc://192.168.0.100/Video.ts">link</a> and click that in emulator's browser and see what does StartActivity do with it...
iOS version the VLC:// handling is in URLHandler.swift
Code: Select all
public class VLCCallbackURLHandler: NSObject, VLCURLHandler {
@objc public func canHandleOpen(url: URL, options: [UIApplication.OpenURLOptionsKey: AnyObject]) -> Bool {
return url.scheme == "vlc"
} ....
var parsedString = url.absoluteString.replacingOccurrences(of: "vlc://", with: "")
That works because Safari fixes URLs like "vlc://
http://example.org" to "vlc://http//example.org"
So please.. Could some one who understands this better and has IDE running, tweak this quite "easy" problem...
Re: VLC launch from browser with m3u or with any media link?
Posted: 25 Dec 2018 09:14
by realjobe
Well.. I Found the "Cure"!
FIXED!!
\vlc-android-master\medialibrary\src\org\videolan\medialibrary\media\MediaWrapper.java
Code: Select all
/**
* Create a new MediaWrapper
* @param mrl Should not be null.
*/
public MediaWrapper(long id, String mrl, long time, long length, int type, String title,
String filename, String artist, String genre, String album, String albumArtist,
int width, int height, String artworkURL, int audio, int spu, int trackNumber,
int discNumber, long lastModified, long seen, boolean isThumbnailGenerated) {
super();
if (TextUtils.isEmpty(mrl)) throw new IllegalArgumentException("uri was empty");
if (mrl.charAt(0) == '/')
mrl = "file://"+mrl;
<FIX START!>
if (mrl.startsWith("vlc"){
mrl.replace("vlc", "http");
}
<FIX END!>
mUri = Uri.parse(mrl);
.....
If I now check if the string mrl has "vlc://" and replace that with http, the system works!
I know that is is not as elegant fix, and some one should make it batter, but it prooves the point... VLC for android has an issue that is easy fix.
Is is possible for the real developers to take on this and perhaps do a pull request and merge it to the breach?
Re: VLC launch from browser with m3u or with any media link?
Posted: 25 Dec 2018 10:02
by realjobe
Re: VLC launch from browser with m3u or with any media link?
Posted: 27 Dec 2018 10:08
by realjobe
I'm sorry to ask, but when to what version/release would this be fixed?
Re: VLC launch from browser with m3u or with any media link?
Posted: 28 Dec 2018 19:13
by realjobe
Will this Be fixed in coming v3.1 version?
Re: VLC launch from browser with m3u or with any media link?
Posted: 07 Jan 2019 15:23
by realjobe
Nigthly builds?
Re: VLC launch from browser with m3u or with any media link?
Posted: 16 Jan 2019 08:55
by realjobe
Dear All.
15.01.2019 VLC for Android 3.0.94 has not yet the vlc://http://. URI schema fix.
Re: VLC launch from browser with m3u or with any media link?
Posted: 21 Jan 2019 00:10
by Jean-Baptiste Kempf
File a bug on the Android bugtracker.
Re: VLC launch from browser with m3u or with any media link?
Posted: 21 Jan 2019 09:26
by realjobe
Well... It is already an issue in
https://code.videolan.org/videolan/vlc- ... issues/708 but it has not been started yet, so....
Re: VLC launch from browser with m3u or with any media link?
Posted: 23 Jan 2019 09:17
by realjobe
Sorry to bother you, but VLC for Android v3.0.95 , updated 22.01.2019 did not include the vlc://http:// URI scheme fix..
Re: VLC launch from browser with m3u or with any media link?
Posted: 25 Jan 2019 12:28
by realjobe
Hi.. Quite fast deployments !
Wow!
24.01.2019 v3.0.96 already out.... well.. URI schema is still not fixed.
Re: VLC launch from browser with m3u or with any media link?
Posted: 02 Mar 2019 05:54
by mrlution
vlc://
http://URI schema on android is still not fixed.
Re: VLC launch from browser with m3u or with any media link?
Posted: 14 Mar 2019 06:52
by realjobe
THANK YOU!!
Thank you Nicolas Pomepuy for the Fix!!
13th March 2019. v3.1.0-RC3 fixed this issue..
Case closed!!!
Re: VLC launch from browser with m3u or with any media link?
Posted: 14 Mar 2019 10:05
by Aza
You're welcome