load thumbnail
This commit is contained in:
@ -1,14 +1,24 @@
|
||||
(() => {
|
||||
const findUpstream = () => {
|
||||
const findUpstreamVideo = () => {
|
||||
const search = new URLSearchParams(location.search);
|
||||
search.set("render", "false");
|
||||
search.set("poster", "false");
|
||||
const url = new URL(location.origin);
|
||||
url.pathname = location.pathname;
|
||||
url.search = search.toString();
|
||||
return url.href;
|
||||
}
|
||||
const findUpstreamPoster = () => {
|
||||
const search = new URLSearchParams(location.search);
|
||||
search.set("render", "false");
|
||||
search.set("poster", "true");
|
||||
const url = new URL(location.origin);
|
||||
url.pathname = location.pathname;
|
||||
url.search = search.toString();
|
||||
return url.href;
|
||||
}
|
||||
|
||||
const upstream = findUpstream();
|
||||
const upstream = findUpstreamVideo();
|
||||
const xhr = new XMLHttpRequest();
|
||||
xhr.open("HEAD", upstream, true);
|
||||
xhr.send();
|
||||
@ -37,6 +47,7 @@
|
||||
options.plugins.chromecast = {};
|
||||
options.plugins.chromecast.addButtonToControlBar = false;
|
||||
const player = videojs(video, options);
|
||||
player.poster(findUpstreamPoster());
|
||||
const source = {};
|
||||
source.type = ctype;
|
||||
source.src = upstream;
|
||||
|
Reference in New Issue
Block a user