videojs / videojs-flash

The Flash tech for video.js
Other
215 stars 52 forks source link

Flash plugin hangs on RTMP stream if Flash disabled on Chrome #137

Closed EZWrighter closed 3 years ago

EZWrighter commented 5 years ago

Including the flash plugin and 2 streams, the first one being 'rtmp/mp4' and second one being 'application/x-mpegURL' Chrome will show a play button, but clicking on it does nothing if flash is blocked. Setting log.level to 'all' shows no debug output. Setting techOrder seems to have no affect.

If flash is enabled, the rtmp stream works as expected. If the plugin or the 'rtmp/mp4' stream is removed, then HLS plays as expected.

Using the latest libraries: https://vjs.zencdn.net/7.6.0/video.js https://cdn.jsdelivr.net/npm/videojs-flash@2/dist/videojs-flash.min.js

Ubuntu - Chrome 74.0.3729.169 (Official Build) (64-bit)

gkatsev commented 5 years ago

What have you tried setting the techOrder to? I'd imagine that ["html5"] should work. But the issue is that we select the first source that a tech says it can play (though, it should ignore those that are available but aren't in the techOrder). This means that if the rtmp source is first and videojs-flash is available, it'll choose that. It doesn't know whether flash is disabled or not. We also currently don't have any mechanism in Video.js or this plugin to detect whether the loading has taken too long and go to a different source or switch sources on an error. I would definitely recommend just removing the rtmp source.

EZWrighter commented 5 years ago

Thanks for your response, however removing the rtmp source is not an option as HLS is a very poor option for our needs as we want as close to real time as possible. We use the HLS as a backup if the viewer doesn't have or doesn't want to enable flash. Is there really no way to keep the rtmp/flash plugin from getting hung up if flash is disabled and moving on to the next source?

and Yes, the HLS source does play if I force tech order to "html5", but that doesn't allow RTMP first option :-(

I guess I have to check flash first before I set the sources...which seems like the wrong way to do this, but I guess it will solve the problem for now.

gkatsev commented 5 years ago

You could try setting the source list manually and do something like:

player.src([
  isFlashAvailable() ? {src: 'rtmp://...', type: 'rtmp/mp4' } : '',
  {src: 'https://../foo.m3u8, type: 'application/x-mpegurl' }
]);
EZWrighter commented 5 years ago

Yep, that is my plan...it just seems like a hung plugin on a player that touts being able to have multiple sources is a bug. One I can most likely work around, with similar code as to what you describe.

gkatsev commented 5 years ago

Yeah, we've thought about adding it in but due to flash on the way out and our limited time, we've ended up working on things that we felt were more important (like starting laying the framework for low latency hls in VHS).

EZWrighter commented 5 years ago

The interesting part is this worked fine in videojs 5. Now it's regressed in 7.6, so I was surprised by the behavior. Anyway, totally understand picking and choosing your battles...LHLS looks promising, now hoping my feed will support it in the future!

gkatsev commented 5 years ago

Flash with Video.js 5 probably doesn't really work accurately anymore. Because we can't accurately and synchronously detect Flash support, we assume that Flash exists in Chrome. This means that the tech will always get selected. This wasn't the case with v5 where Flash in Chrome is probably always detected as not available.