mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
Fixed issue socket-io cannot be connected in production build on web
This commit is contained in:
parent
1e3464fe47
commit
c4247bfea3
3 changed files with 14 additions and 1 deletions
|
|
@ -45,26 +45,32 @@
|
|||
const loadVideoData = async () => {
|
||||
isThumbnailVideoPlaying = false;
|
||||
const videoUrl = `/asset/file?aid=${asset.deviceAssetId}&did=${asset.deviceId}&isWeb=true`;
|
||||
|
||||
if ($session.user) {
|
||||
try {
|
||||
const res = await fetch(serverEndpoint + videoUrl, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
Authorization: 'bearer ' + $session.user.accessToken,
|
||||
'Accept-Range': 'bytes',
|
||||
},
|
||||
});
|
||||
|
||||
videoData = URL.createObjectURL(await res.blob());
|
||||
|
||||
videoPlayerNode.src = videoData;
|
||||
// videoPlayerNode.src = videoData + '#t=0,5';
|
||||
|
||||
videoPlayerNode.load();
|
||||
|
||||
videoPlayerNode.onloadeddata = () => {
|
||||
console.log('first frame load');
|
||||
};
|
||||
|
||||
videoPlayerNode.oncanplaythrough = () => {
|
||||
console.log('can play through');
|
||||
};
|
||||
|
||||
videoPlayerNode.oncanplay = () => {
|
||||
console.log('can play');
|
||||
videoPlayerNode.muted = true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue