VLC launch from browser with m3u or with any media link?

VLC for Android and Chrome OS specific usage questions
realjobe
Cone that earned his stripes
Cone that earned his stripes
Posts: 175
Joined: 10 Feb 2008 15:40

VLC launch from browser with m3u or with any media link?

Postby realjobe » 17 Dec 2018 07:16

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

unidan
Developer
Developer
Posts: 1494
Joined: 25 Mar 2018 01:00

Re: VLC launch from browser with m3u or with any media link?

Postby unidan » 17 Dec 2018 16:50

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.

realjobe
Cone that earned his stripes
Cone that earned his stripes
Posts: 175
Joined: 10 Feb 2008 15:40

Re: VLC launch from browser with m3u or with any media link?

Postby realjobe » 17 Dec 2018 17:40

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..

realjobe
Cone that earned his stripes
Cone that earned his stripes
Posts: 175
Joined: 10 Feb 2008 15:40

Re: VLC launch from browser with m3u or with any media link?

Postby realjobe » 18 Dec 2018 09:05

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...

realjobe
Cone that earned his stripes
Cone that earned his stripes
Posts: 175
Joined: 10 Feb 2008 15:40

Re: VLC launch from browser with m3u or with any media link?

Postby realjobe » 25 Dec 2018 09:14

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?

realjobe
Cone that earned his stripes
Cone that earned his stripes
Posts: 175
Joined: 10 Feb 2008 15:40

Re: VLC launch from browser with m3u or with any media link?

Postby realjobe » 25 Dec 2018 10:02


realjobe
Cone that earned his stripes
Cone that earned his stripes
Posts: 175
Joined: 10 Feb 2008 15:40

Re: VLC launch from browser with m3u or with any media link?

Postby realjobe » 27 Dec 2018 10:08

I'm sorry to ask, but when to what version/release would this be fixed?

realjobe
Cone that earned his stripes
Cone that earned his stripes
Posts: 175
Joined: 10 Feb 2008 15:40

Re: VLC launch from browser with m3u or with any media link?

Postby realjobe » 28 Dec 2018 19:13

Will this Be fixed in coming v3.1 version?

realjobe
Cone that earned his stripes
Cone that earned his stripes
Posts: 175
Joined: 10 Feb 2008 15:40

Re: VLC launch from browser with m3u or with any media link?

Postby realjobe » 07 Jan 2019 15:23

Nigthly builds?

realjobe
Cone that earned his stripes
Cone that earned his stripes
Posts: 175
Joined: 10 Feb 2008 15:40

Re: VLC launch from browser with m3u or with any media link?

Postby realjobe » 16 Jan 2019 08:55

Dear All.

15.01.2019 VLC for Android 3.0.94 has not yet the vlc://http://. URI schema fix. :)

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: VLC launch from browser with m3u or with any media link?

Postby Jean-Baptiste Kempf » 21 Jan 2019 00:10

File a bug on the Android bugtracker.
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

realjobe
Cone that earned his stripes
Cone that earned his stripes
Posts: 175
Joined: 10 Feb 2008 15:40

Re: VLC launch from browser with m3u or with any media link?

Postby realjobe » 21 Jan 2019 09:26

Well... It is already an issue in https://code.videolan.org/videolan/vlc- ... issues/708 but it has not been started yet, so.... :)

realjobe
Cone that earned his stripes
Cone that earned his stripes
Posts: 175
Joined: 10 Feb 2008 15:40

Re: VLC launch from browser with m3u or with any media link?

Postby realjobe » 23 Jan 2019 09:17

Sorry to bother you, but VLC for Android v3.0.95 , updated 22.01.2019 did not include the vlc://http:// URI scheme fix.. :)

realjobe
Cone that earned his stripes
Cone that earned his stripes
Posts: 175
Joined: 10 Feb 2008 15:40

Re: VLC launch from browser with m3u or with any media link?

Postby realjobe » 25 Jan 2019 12:28

Hi.. Quite fast deployments ! :) Wow!

24.01.2019 v3.0.96 already out.... well.. URI schema is still not fixed. :)

mrlution
New Cone
New Cone
Posts: 1
Joined: 02 Mar 2019 05:51

Re: VLC launch from browser with m3u or with any media link?

Postby mrlution » 02 Mar 2019 05:54

vlc://http://URI schema on android is still not fixed.

realjobe
Cone that earned his stripes
Cone that earned his stripes
Posts: 175
Joined: 10 Feb 2008 15:40

Re: VLC launch from browser with m3u or with any media link?

Postby realjobe » 14 Mar 2019 06:52

THANK YOU!!
Thank you Nicolas Pomepuy for the Fix!!

13th March 2019. v3.1.0-RC3 fixed this issue..

Case closed!!!

Aza
Developer
Developer
Posts: 2206
Joined: 14 Mar 2019 10:04

Re: VLC launch from browser with m3u or with any media link?

Postby Aza » 14 Mar 2019 10:05

You're welcome :D


Return to “VLC for Android and Chrome OS”

Who is online

Users browsing this forum: No registered users and 24 guests