videojs-sprite-thumbnails icon indicating copy to clipboard operation
videojs-sprite-thumbnails copied to clipboard

Plugin does not respect videojs.Vhs.xhr.beforeRequest

Open venomone opened this issue 3 years ago • 3 comments

Hello again,

I've now got your plugin running (Yeah!), but I sadly cannot pull the sprites image from my backend, as it does not respect videojs.Vhs.xhr.beforeRequest. Result in 401 Unauthorized at my browser. The Video Playback itself works fine as the header gets set but without, I practically cannot pull any data from my backend servers

                            videojs.Vhs.xhr.beforeRequest = function (options) {
                                options.headers = options.headers || {};
                                options.headers.Authorization = "{{ access_token }}";
                            };

Is it possible to add compatibility to your code for beforeRequest to set an Authorization header? Would be Awesome!

Many Thanks in advance.

venomone avatar Jun 01 '22 09:06 venomone

The vhs.xhr function is part of the http-streaming plugin.

Does it work when you parse/replace the ampersands in the sprite url correctly? https://github.com/phloxic/videojs-sprite-thumbnails/issues/26#issuecomment-1146804206

phloxic avatar Jun 05 '22 13:06 phloxic

As far as I know, the vhs.xhr part was of videoJS 6 but 7 hast this already integrated. At least I can use HLS streaming without http-streaming Plugin in videoJS 7. Anyway, I tried it with and without, both isnt working for me. Currently I really have to generate an s3 link and pass it to my template where I show the actual Video.

venomone avatar Jun 05 '22 16:06 venomone

VideoJS 7 ships with VHS by default, but it's still a plugin and not part of core VideoJS.

The sprite thumbnails plugin does nothing video or streaming specific, it just sets the sprite image as CSS background-image for the timeline tooltip. So an s3 link generated for this purpose should work.

phloxic avatar Jun 10 '22 20:06 phloxic