strange case of MSE and the "Worker"

sulphur

Member
Hi,

I finally succeed in playing a stream using MSE provider. I was having issues with MSE Provider I wasn't able to play a stream on my website ( I could play it with the examples though). So definitely something on my website is causing problems. This was the error before:

Screenshot 2021-01-27 at 09.51.36.png


The error I had with MSE player somewhere in the ServiceWorker code and inside the flashphoner.js file. So what I did yesterday after few weeks of searching is that I modified the flashphoner.js and forced the enableWorker=false in the code in createConnection() function. When I did that the MSE provider was working without any problems :
Screenshot 2021-01-27 at 09.15.27.png



So my question is What is this Service worker doing normally and is it really needed? Do you have any clues on what might provoke such conflict on my website? I see that it is complaining about _typeof3() function is not defined. So maybe my webpack is breaking something here? I'm including the flashphoner.js during my webpack build process in order to generate a chunk with my video player.
Code:
import Flashphoner from '../../flashphoner-api-0.5.28/flashphoner-no-flash.js';
import { Browser, resizeVideo } from './utils.js'
I will try to find the issue anyway since I don't like tampering the code that is not mine ;) and also I don't know what will beak if i disable this worker. But you you have any clues for me it would be very welcome.

Best regards
Piotr[/CODE]
 

Attachments

sulphur

Member
I can confirm this is definitely some webpack build issue. When I include the flashphoner.js file directly in <body/> then MSE provider is working
 

Max

Administrator
Staff member
So maybe my webpack is breaking something here?
This is probably webpack build issue. We cannot reproduce this in Player example out of the box.
We use Grunt with Browserify to build flashphoner.js from sources.
 

sulphur

Member
Ok, so I have managed to get it to work by using the external loader un webpack. This way my flashphoner.js is unaltered which is better in the end ;) and my MSE player is working as it should.

However, I saw another problem. On WSPlayer the stream.getStreamResolution() always return {width: undefined, height: undefined} even after 30sec of stream being played. So it is quite hard to adjust the viewport CSS ( i need to detect the portrait/landscape rotation)
 

Max

Administrator
Staff member
However, I saw another problem. On WSPlayer the stream.getStreamResolution() always return {width: undefined, height: undefined} even after 30sec of stream being played. So it is quite hard to adjust the viewport CSS ( i need to detect the portrait/landscape rotation)
WSPlayer is obsolete an not supported now. This technolofy is intended to use in old iOS Safari versions which not support WebRTC yet. Also, WSPlayer requires stream transcoding on server and increases server CPU and memory load.
Please consider migration to WebRTC and (if you still have customers with ancient iOS devices) to HLS for stream playback.
When WebRTC is used, current playing stream parameters can be obtained from browser statistics. Please see the example code to display WebRTc statistics data here. The resolution metrics are width and height.
 

sulphur

Member
Ok, I am not really using WSPlayer, for now, it is more like a fallback option for when WebRTC and MSE don't work ( which anyways should cover almost all devices right ?).

Just to be sure. You are saying is that you recommend a fallback from WebRTC to HLS directly instead of trying MSE provider first?

Oh and you information I'm building a completely new project so no customers and no legacy for now ;)
 

Max

Administrator
Staff member
Just to be sure. You are saying is that you recommend a fallback from WebRTC to HLS directly instead of trying MSE provider first?
Oh and you information I'm building a completely new project so no customers and no legacy for now
In this case we recommend you to use WebRTC for playback if possible. It is supported in the latest builds of three main browsers: Chrome, Firefox on Windows/Linux/MacOS/Android and Safari on MacOS/iOS. And yes, in new MS Chromium Edge (not Legacy Edge) it also works.
If the viewer uses some other browser, or uses non-Safari on iOS, it is preferrable to play a stream via HLS.
 

sulphur

Member
ok, So I will focus more on WebRTC/HLS pair and will drop the MSE and WSPlayer. I have some good xp with HLS in prod so it should be a problem ;)

Thanks for your help
 
Top