jDownloads Support Forum

Older Versions => jDownloads 3.2 (Support ended) => Suggestions - Feature Request => Topic started by: Dode on 08.06.2015 18:38:44

Title: Switch Flowplayer from Flash to HTML5 ?
Post by: Dode on 08.06.2015 18:38:44
Hello there,

JDownloads is using Flowplayer to display preview files (MP3 or videos), but actually only in Flash form. Does anyone knows a way to switch the Flash display to HTML5 as Flowplayer explicitly suports it ?
I need displaying some MP3 previews on smartphones and tablets, as Flash is not an option anymore for these devices.

Thanks.

PS : https://flowplayer.org
Title: Re: Switch Flowplayer from Flash to HTML5 ?
Post by: Arno on 20.06.2015 14:54:20
Hi,
yes you have right we must find a solution for this very soon.
Title: Re: Switch Flowplayer from Flash to HTML5 ?
Post by: wolfspyryt on 28.07.2015 21:07:49
Yes Please!  :) :) :)
Title: Re: Switch Flowplayer from Flash to HTML5 ?
Post by: matthiku on 08.09.2015 10:41:18
This is a very much needed feature as more and more users want to get away from the security risk flash and mobile devices generally don't support it at all.

A relatively easy solution (if you know a little bit of PHP) is to change the relevant code in each DEFAULT.PHP file of the various views, located in their TMPL subfolders.

But you have to repeat this change each time you upgrade to the latest version of jdownloads.

Example for the 'category' view (which lists all downloads of a certain category):
file 'default.php' in '\components\com_jdownloads\views\category\tmpl' -

Search for this line:
$html_file = str_replace('{mp3_player}', $mp3_player, $html_file); 

And insert this line before:
$mp3_player = '<audio><source src="'.$mp3_path.'" type="audio/mpeg"></audio> ';

Of course this only works for audio files. One could add a condition to use the <video> tags instead if it's a video file...

Let me know if anyone needs more detailed instructions.
Title: Re: Switch Flowplayer from Flash to HTML5 ?
Post by: Arno on 08.09.2015 12:28:08
Hi matthiku,
thanks for your example.
We will change this very fast now. But we should add for this also a special option in configuration.
Title: Re: Switch Flowplayer from Flash to HTML5 ?
Post by: Arno on 08.09.2015 13:40:27
It seems that in the meantime nearly all current browser versions supported HTML5 video and audio elements.
See here:
http://caniuse.com/#feat=video
and here:
http://caniuse.com/#feat=audio

So i think we need not really a solution with fallback function (to flash).
So i will add only a simple option for use html5 instead flash.
This should be enough, or?

Edit:
We can in the next main version jD 3.3 add the open source HTML5 video player from www.Videojs.com.
Title: Re: Switch Flowplayer from Flash to HTML5 ?
Post by: matthiku on 08.09.2015 14:17:13
Totally agree. No need for a fallback to any flashplayer.

Thanks for all your great efforts with jDownloads!

Any idea when this feature will be available?
Title: Re: Switch Flowplayer from Flash to HTML5 ?
Post by: Arno on 08.09.2015 14:19:28
I will try to get it ready this week. ;)
I know it is important!
Title: Re: Switch Flowplayer from Flash to HTML5 ?
Post by: Arno on 09.09.2015 00:39:24
A few snapshots from the new feature...  ;)

[gelöscht durch Administrator]
Title: Re: Switch Flowplayer from Flash to HTML5 ?
Post by: Dode on 09.09.2015 12:32:53
I would have prefer Video.js or MediaElements.js, but this is already a nice evolution !
A Simple question, do the width/height parameters also apply to audio elements ?
Title: Re: Switch Flowplayer from Flash to HTML5 ?
Post by: Arno on 09.09.2015 13:09:18
QuoteA Simple question, do the width/height parameters also apply to audio elements ?
No. But i have a little problem with the .ogg file format. This can be a video or an audio file.
So i must use it as default as video file (with width/height parameters). Or has anybody another solution?

video.js will come in the next step.
Title: Re: Switch Flowplayer from Flash to HTML5 ?
Post by: Dode on 09.09.2015 13:16:28
Generally, ogg files come with the .oga extension for audio, and .ogv extension for video. At least that's what i used in the past.
Sad for the width of the audio player, as i need it to be to a very specific size (see file attached)... This is one of the reason why i prefer MediaElements or Video.js.

[gelöscht durch Administrator]
Title: Re: Switch Flowplayer from Flash to HTML5 ?
Post by: Dode on 09.09.2015 13:27:30
Quote from: Arno on 09.09.2015 13:09:18video.js will come in the next step.
I wonder if MediaElement.js is not a better choice these days ?
http://mediaelementjs.com
Title: Re: Switch Flowplayer from Flash to HTML5 ?
Post by: Arno on 09.09.2015 13:46:34
QuoteI wonder if MediaElement.js is not a better choice these days ?
Seems that every user has her own favorite script. Everybody tells me another.  ::)

I have not enough experiences with this type of scripts. So i can not really compare it.
It should be an open source solution and the configuration should be not to complicated.
And i am not sure that it must have a flash option.

We have in the current release the Flowplayer which is for me a little bit complicated and not really free.
So we must find a better solution with supported also HTML5. 

QuoteGenerally, ogg files come with the .oga extension for audio, and .ogv extension for video. At least that's what i used in the past.
Thanks for this info. I have not worked with this format until today.
I wondering why in all examples is used the .ogg file extension (for video AND audio elements)?  ::)
Title: Re: Switch Flowplayer from Flash to HTML5 ?
Post by: Arno on 09.09.2015 14:28:20
QuoteSad for the width of the audio player, as i need it to be to a very specific size (see file attached)..
Okay. We can use also a param for the width from the audio player.

[gelöscht durch Administrator]
Title: Re: Switch Flowplayer from Flash to HTML5 ?
Post by: Dode on 09.09.2015 14:59:57
Perfect for me, excellent work Arno !
As for the choice of the JS player, yes i understand it's not easy to choose. Here is a simple and recent comparison chart that may help you : http://praegnanz.de/html5video/
Note that Video.js is not that great for a basic audio player, it's really video centric.
Title: Re: Switch Flowplayer from Flash to HTML5 ?
Post by: Arno on 09.09.2015 15:11:59
Hm... i test in the moment the video.js script. It seems to be very simple and easy to use. Maybe i should directly use a solution like this. I will reconsider this tonight.  :)

MediaElement.js seems to be more complicated (on the first look).
Title: Re: Switch Flowplayer from Flash to HTML5 ?
Post by: Dode on 10.09.2015 01:42:17
Video.js doesn't use JQuery, which might be an advantage for sure. But for audio, even with the latest release (>4.9, <audio> canvas support), it has to display a "picture" of the size of a potential video, generally the "jacket" (not sure of the english word, sorry).
MediaElement has much better support for audio, and can just display a simple "bar", as usual.
Your choice Arno ;-) .
Please other users, let us know what you think about this !
Title: Re: Switch Flowplayer from Flash to HTML5 ?
Post by: ColinM on 10.09.2015 02:16:34
Hi
This might be a bit of a simplistic view but why not have two sets! One that is very good for Audio only files and the other that works well for Video. ;D

Flow player managed to do both quite well but it used Flash so not good now.  There is nothing that says there should be a "catch all". 
jD uses imagemagic for graphics, no one expects it to support audio, video and ....

And it always strikes me that trying to do all things can lead to compromises!

It is also probably simpler for users to understand the setup if they are separate.  As far as I am concerned Audio and Video are different animals; it just happens that video has an audio facility that is married to the video.  I am sure that Dode can recommend an excellent audio only package.

We should not let one facility compromise another one.

Colin
Title: Re: Switch Flowplayer from Flash to HTML5 ?
Post by: Dode on 10.09.2015 02:29:59
FlowPlayer is kindda commercial now, so it seems out of the equation.
Maybe separating audio and video displaying is the solution (i love SoundManager2 for audio http://www.schillmania.com/projects/soundmanager2/), but it will get things complicated, no ? MediaElement.js seems to me the simpliest solution for JDownloads : single setup, to rule them all.
Arno is right, it must be simple and cover most usages.
I would love to see other users opinion.