Search…

X3 Photo Gallery Support Forums

Search…
 
hh2204
Topic Author
Posts: 5
Joined: 25 Oct 2021, 20:46

Support M3U8?

16 Dec 2021, 05:15

Hope to support M3U8
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13993
Joined: 30 Sep 2006, 03:37

Re: Support M3U8?

16 Dec 2021, 05:43

So I guess you mean you want to upload a m3u8 file, and when clicked, Files app will play the remote video/audio streams referenced within? It may be possible to extract data from m3u8 with PHP, but I'm more concerned about what you want to do with the stream links in the playlist. Since they are not files in the file system, we can't display them like all the other files, because there are entirely different properties involved.

A better solution might be when the m3u8 file is clicked, it opens a player in a modal window, that can play items referenced in the m3u8 playlist. As long as these files are supported by browsers of course.
 
hh2204
Topic Author
Posts: 5
Joined: 25 Oct 2021, 20:46

Re: Support M3U8?

16 Dec 2021, 07:42

Yes, click M3U8 to pop up the playback window.
TS file exclusion
'files_exclude' =>'/\.(ts)$/i'
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13993
Joined: 30 Sep 2006, 03:37

Re: Support M3U8?

17 Dec 2021, 01:27

hh2204 wrote:Yes, click M3U8 to pop up the playback window.
TS file exclusion
'files_exclude' =>'/\.(ts)$/i'
Do you have an example of this somewhere else? Assuming the files are *.ts then? Browsers might not support this format. Also, when you click the M3U8 file, we will need some kinda player ...

If you already know a player that support M3U8 and creating a playlist, then it can already be done.
 
hh2204
Topic Author
Posts: 5
Joined: 25 Oct 2021, 20:46

Re: Support M3U8?

18 Dec 2021, 08:55

 
User avatar
mjau-mjau
X3 Wizard
Posts: 13993
Joined: 30 Sep 2006, 03:37

Re: Support M3U8?

19 Dec 2021, 01:12

That's interesting, thanks for the examples.

I need to think about how this can be done. I'm not sure about loading external video-player plugin into the "popup" (which currently displays normal browser-supported videos like mp4 / demo). However, we can probably load the video either in a popup or some modal overlay. One thing to mention, is that if you have the *.ts files located in the same folder as the *.m3u8 file, they will also display in the Files gallery unless you hide the  extension.

It seems several Javascript video players can support the m3u8/streaming format: videojs.comhls.jsmediaelementjs.com / jwplayer.com

Temporary solution
I don't know if you are interested, but you can get this to work already with a workaround.
  1. In config set 'click_window' => 'm3u8', which will open m3u8 files in new browser window.
  2. On your NGINX server, redirect *.m3u8$ requests to dplayer/?videourl={%PATH%}
When user clicks m3u8 file in Files app, it will open popup window with the player, similar to your example:
*/player/dplayer/?videourl=,*/player/demo/a/index.m3u8

I'm not 100% sure how to setup the redirect with nginx, but the above is definitely possible.
 
hh2204
Topic Author
Posts: 5
Joined: 25 Oct 2021, 20:46

Re: Support M3U8?

20 Dec 2021, 07:47

I tried
NGINX redirection M3U8 cannot be played :disappointed:

demo.cxbb.cc
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13993
Joined: 30 Sep 2006, 03:37

Re: Support M3U8?

20 Dec 2021, 08:47

hh2204 wrote: I tried
NGINX redirection M3U8 cannot be played :disappointed:
demo.cxbb.cc
Actually, it's ALMOST working, but there is a problem I didn't think about. Since you have a REDIRECT for *.m3u8 files, it will also redirect the request made by dplayer when it tries to load the m3u8 file:
Image
As you can see, it tries to load the m3u8 file, but this request is then redirected to the player again :thinking:  :confused:

I can't immediately think of a good solution. Perhaps you could check the REFERER in your REDIRECT rule?
Image
Only apply the redirect if the request does NOT come from /dplayer/ ...
 
hh2204
Topic Author
Posts: 5
Joined: 25 Oct 2021, 20:46

Re: Support M3U8?

21 Dec 2021, 05:52

I'll wait for the new version, I hope to support M3U8