Skip to content

response.data is already detached when hook the fLoader #4336

@snowinszu

Description

@snowinszu

What version of Hls.js are you using?

latest

What browser (including version) are you using?

chrome

What OS (including version) are you using?

macOS

Test stream

https://test-streams.mux.dev/x36xhzz/url_8/193039199_mp4_h264_aac_fhd_7.m3u8

Configuration

class fLoader extends Hls.DefaultConfig.loader {
        constructor(config) {
            super(config);
            var load = this.load.bind(this);
            this.load = function (context, config, callbacks) {
                var onSuccess = callbacks.onSuccess;
                callbacks.onSuccess = function (response, stats, context) {
                    console.warn(`byteLength ${response.data.byteLength}`)
                    onSuccess(response, stats, context);
                };
                load(context, config, callbacks);
            };
        }
    }
var hls = new Hls({
            fLoader,
        });

Additional player setup steps

No response

Checklist

Steps to reproduce

  1. set floader
  2. play the stream

Expected behaviour

response.data.byteLength is > 0

What actually happened?

response.data.byteLength == 0

Console output

byteLength 0

Chrome media internals output

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions