I tried Angular universal but apparently is not compatible with video rendering in safari, all other navigators are fine.

Apparently there is a problem of byte-range but could you please let me find a way to implement it on angular 7 with angular universal ?

<video autoplay loop [muted]="true">
  <source src="assets/video/{{p.shortname}}.mp4" type="video/mp4" />
  <source src="assets/video/{{p.shortname}}.webm" type="video/webm" />
</video>

I expect to see my video rendering in all navigators even safari

1 Answers

0
mbagiella On

Finally I found a workaround but it is still a workaround and not an acceptable answers.

on ngsw-worker.js (node_modules/@angular/service-worker) added return;

onFetch(event) {
        return; // it makes video works in safari
        const req = event.request;
        const scopeUrl = this.scope.registration.scope;
        const requestUrlObj = this.adapter.parseUrl(req.url, scopeUrl);
        // The only thing that is served unconditionally is the debug page.
        if (requestUrlObj.path === '/ngsw/state') {
            // Allow the debugger to handle the request, but don't affect SW state in any other way.
            event.respondWith(this.debugger.handleFetch(req));
            return;
}