Libretime: Replace Adobe Flash - It will get obsoleted and firefox complains about blocked object

Created on 18 Jul 2017  ·  13Comments  ·  Source: LibreTime/libretime

I do not know if it's the right place to submit a suggestion but I think this issue deserves it.

There is a big discussion on the internet about why we should avoid the use of Adobe Flash in our developments. I personally hate it and block any site with Adobe Flash, and this is not just my personal preference, in the near future, Flash will be obsoleted. Actually there is no need for it to get a music player. Nowadays every browser supports HTML5 audio tags. (Still we could support some back compatibility in case of users with older browser) But I would suggest to REPLACE FLASH ASAP !

I thought we were using JPlayer http://www.jplayer.org

tracks

  • [ ] #518
3.0-release-blocker bug enhancement

All 13 comments

What I saw so far does indicate that we use jPlayer. The radio page also loads muses so it's probably a case of using multiple things that do the same job. 🤷‍♂️

I can only seem to reproduce the error in Firefox. Webkit browser like Chrome and Safari don't complain and don't seem to load any swf as far as I can tell (of those two Chrome would usually complain about such things).

The popup player from the backend works in Firefox without flash.

There is more flash lurking in the datatables part of the js where it's used to enable a print button on history lists and the likes. Updating/Rewriting datatables has proven tougher than I expected so far.

For the audio flash parts we should absolutely switch to a solution that doesn't show any popups in for end users and uses HTML5 audio as the default without triggering Firefox's flash warning.

Personally I'd be happy to kick all flash to the curb. I'm not sure if anyone has a large user base that still relies on legacy browsers that need flash for audio.

Hello,

I've imported the new mrp.js hosted here https://hosted.muses.org/mrp.js and added the parameter 'forceHTML5':true in /usr/share/airtime_mvc/application/views/scripts/embed/player.phtml

this.settings = { 'volume': 100, 'forceHTML5': true, 'jsevents': true, 'autoplay': false, 'buffering': 0, 'title': 'test', 'bgcolor': '#FFFFFF', 'skin': 'mcclean', 'reconnectTime' : 2000, //Doesn't seem to do anything 'width': 180, 'height': 60 };

With Firefox, it's ok, no more complains about flash module, the player work.
With Safari and chrome, the player is broken :-(

TypeError: undefined is not an object (evaluating 'musesPlayer.play')

I don't know anything about js, it's possible that real dev can correct this as a quick workaround for this issue.

OliCat

We should also check on the widget player. I know that for some reason flash is attempted on Firefox for my libretime instance.

quick and realy dirty hack for html5 only player:

in mrp.js at the end (line 2978) replace

n.FlashDetect = function() ...

with

n.FlashDetect = function() {}()

and comment or delete the remaining function-body - this just does not run the flash-detection code and should fall back to html5

Thanks for sharing. Lets think about how we can make this a user configurable setting, defaulting to not using flash or perhaps we just decide to no longer support flash or even replace the whole widget overall. I know that I run into issues with it intermittently not working on various computers for my station and I haven't spent the time to track down the causes of each failure and whether this would just make it work on less computers.

I guess it's 2018 and flash is dead and for the project ditching flash and updating the player would be the best option. However just replacing mrp.js did not work for me.

Are there any usecases for flash left?

I think we just need to do a good job of analyzing browser compatibility at this point with the widget. I think there are some bugs and the SSL cross-site can be an issue with chrome. Testing it without flash on the major browsers is a good idea before we dump flash completely.

So replacing the player that currently ships with LibreTime is a release blocker? Is anyone working on this now?

If not, possibly there's some overlap & potential for collaboration with projects mentioned in this forum discussion? https://discourse.libretime.org/t/custom-audio-players/140

This is best probably done in conjunction with #461 if we end up replacing the web player. Also noticed that Firefox blocked the audio preview by default because it relies upon auto play and also has no Play button.

So would it make sense for the same folks working on #461 to resolve this at the same time? Just out of curiosity, how does the AzuraCast player compare? Does it also have some of the same issues or is there functionality that might be good to roll in?

https://www.azuracast.com/about/screenshots.html#public-player-page

This looks like it's the 3.0 blocking-tracker for #518

How about making a new web player? I found a Javascript library for creating players in HTML5 (no Flash option) called Howler.js. An example player:

var sound = new Howl({
  src: ['stream1', 'stream2', 'stream3'],
  autoplay: true,
  volume: 0.5,
});

@Robbt @gusaus I'm currently working on replacing the media players that may/may not use Flash. So far, I have converted the Listen player on the dashboard; it's ready for testing. I'm getting a lot of caching issues but I think it's consistent with Firefox and my computer. I'm still working on the player widget and the preview player, the latter will take a lot longer but doesn't appear to call Muses at all.

I'll put up a PR for preview soonish.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

paddatrapper picture paddatrapper  ·  9Comments

Robbt picture Robbt  ·  9Comments

hairmare picture hairmare  ·  12Comments

paddatrapper picture paddatrapper  ·  14Comments

paddatrapper picture paddatrapper  ·  13Comments