mirror of
https://github.com/zoriya/Kyoo.git
synced 2026-08-15 18:45:24 +00:00
Fix notification on videojs side
This commit is contained in:
@@ -1,9 +1,29 @@
|
||||
diff --git a/node_modules/@videojs/core/.bun-tag-2ae87bfdc8c60c18 b/.bun-tag-2ae87bfdc8c60c18
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
|
||||
diff --git a/node_modules/@videojs/core/.bun-tag-6ae2888ce9205340 b/.bun-tag-6ae2888ce9205340
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
|
||||
diff --git a/node_modules/@videojs/core/.bun-tag-c99bf98327cf098c b/.bun-tag-c99bf98327cf098c
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
|
||||
diff --git a/dist/default/dom/media/google-cast/google-cast-provider.js b/dist/default/dom/media/google-cast/google-cast-provider.js
|
||||
index 1ab903161eed3118320a71fb2a4be8c606be87de..21cbafc728be9d02cc9890eccf1821874df47108 100644
|
||||
--- a/dist/default/dom/media/google-cast/google-cast-provider.js
|
||||
+++ b/dist/default/dom/media/google-cast/google-cast-provider.js
|
||||
@@ -110,7 +110,11 @@ var GoogleCastProvider = class {
|
||||
});
|
||||
mediaInfo.streamType = this.#googleCast.streamType === "live" ? chrome.cast.media.StreamType.LIVE : chrome.cast.media.StreamType.BUFFERED;
|
||||
mediaInfo.metadata = new chrome.cast.media.GenericMediaMetadata();
|
||||
- mediaInfo.metadata.images = [new chrome.cast.Image(target?.poster ?? "")];
|
||||
+ const castMeta = mediaInfo.customData ?? {};
|
||||
+ if (castMeta.title) mediaInfo.metadata.title = castMeta.title;
|
||||
+ if (castMeta.subtitle) mediaInfo.metadata.subtitle = castMeta.subtitle;
|
||||
+ const castImage = castMeta.poster ?? target?.poster;
|
||||
+ if (castImage) mediaInfo.metadata.images = [new chrome.cast.Image(castImage)];
|
||||
if (await isHls(this.#googleCast.src)) {
|
||||
mediaInfo.contentType ||= "application/x-mpegURL";
|
||||
const fmt = await getPlaylistSegmentFormat(this.#googleCast.src) ?? "";
|
||||
diff --git a/dist/default/dom/media/google-cast/utils.js b/dist/default/dom/media/google-cast/utils.js
|
||||
index 8ca144e0a61f3f25b7628964a2dff818efc689f3..ef2660883dc0be47e18009773d0922a95ac274dd 100644
|
||||
--- a/dist/default/dom/media/google-cast/utils.js
|
||||
@@ -97,7 +117,7 @@ index 99ca6c647292de8ee811f6b0595b23744301fa88..fadfd434b71d2053e6565857a9a8db6a
|
||||
engine?.off(Hls.Events.LEVEL_SWITCHED, this.#onLevelSwitched);
|
||||
engine?.off(Hls.Events.DESTROYING, this.#teardown);
|
||||
diff --git a/dist/default/dom/store/features/remote-playback.js b/dist/default/dom/store/features/remote-playback.js
|
||||
index 9a00dbf2858199afe8a66c8f3796ba78efdfc7bc..d59fc75ad19a88acd94d66b196b78ad9a48d73d1 100644
|
||||
index 9a00dbf2858199afe8a66c8f3796ba78efdfc7bc..16737d05303a2806575ba6ea0984d84bb8266af7 100644
|
||||
--- a/dist/default/dom/store/features/remote-playback.js
|
||||
+++ b/dist/default/dom/store/features/remote-playback.js
|
||||
@@ -1,7 +1,9 @@
|
||||
@@ -166,6 +186,23 @@ index 9a00dbf2858199afe8a66c8f3796ba78efdfc7bc..d59fc75ad19a88acd94d66b196b78ad9
|
||||
const syncState = () => set({ remotePlaybackState: media.remote.state });
|
||||
syncState();
|
||||
listen(media.remote, "connect", syncState, { signal });
|
||||
diff --git a/dist/dev/dom/media/google-cast/google-cast-provider.js b/dist/dev/dom/media/google-cast/google-cast-provider.js
|
||||
index 1ab903161eed3118320a71fb2a4be8c606be87de..21cbafc728be9d02cc9890eccf1821874df47108 100644
|
||||
--- a/dist/dev/dom/media/google-cast/google-cast-provider.js
|
||||
+++ b/dist/dev/dom/media/google-cast/google-cast-provider.js
|
||||
@@ -110,7 +110,11 @@ var GoogleCastProvider = class {
|
||||
});
|
||||
mediaInfo.streamType = this.#googleCast.streamType === "live" ? chrome.cast.media.StreamType.LIVE : chrome.cast.media.StreamType.BUFFERED;
|
||||
mediaInfo.metadata = new chrome.cast.media.GenericMediaMetadata();
|
||||
- mediaInfo.metadata.images = [new chrome.cast.Image(target?.poster ?? "")];
|
||||
+ const castMeta = mediaInfo.customData ?? {};
|
||||
+ if (castMeta.title) mediaInfo.metadata.title = castMeta.title;
|
||||
+ if (castMeta.subtitle) mediaInfo.metadata.subtitle = castMeta.subtitle;
|
||||
+ const castImage = castMeta.poster ?? target?.poster;
|
||||
+ if (castImage) mediaInfo.metadata.images = [new chrome.cast.Image(castImage)];
|
||||
if (await isHls(this.#googleCast.src)) {
|
||||
mediaInfo.contentType ||= "application/x-mpegURL";
|
||||
const fmt = await getPlaylistSegmentFormat(this.#googleCast.src) ?? "";
|
||||
diff --git a/dist/dev/dom/media/google-cast/utils.js b/dist/dev/dom/media/google-cast/utils.js
|
||||
index 8ca144e0a61f3f25b7628964a2dff818efc689f3..ef2660883dc0be47e18009773d0922a95ac274dd 100644
|
||||
--- a/dist/dev/dom/media/google-cast/utils.js
|
||||
@@ -259,7 +296,7 @@ index 99ca6c647292de8ee811f6b0595b23744301fa88..fadfd434b71d2053e6565857a9a8db6a
|
||||
engine?.off(Hls.Events.LEVEL_SWITCHED, this.#onLevelSwitched);
|
||||
engine?.off(Hls.Events.DESTROYING, this.#teardown);
|
||||
diff --git a/dist/dev/dom/store/features/remote-playback.js b/dist/dev/dom/store/features/remote-playback.js
|
||||
index 9a00dbf2858199afe8a66c8f3796ba78efdfc7bc..d59fc75ad19a88acd94d66b196b78ad9a48d73d1 100644
|
||||
index 9a00dbf2858199afe8a66c8f3796ba78efdfc7bc..16737d05303a2806575ba6ea0984d84bb8266af7 100644
|
||||
--- a/dist/dev/dom/store/features/remote-playback.js
|
||||
+++ b/dist/dev/dom/store/features/remote-playback.js
|
||||
@@ -1,7 +1,9 @@
|
||||
|
||||
@@ -94,7 +94,23 @@ export const Player = () => {
|
||||
hasNext: !!data?.next?.video,
|
||||
},
|
||||
castId: `${apiUrl}/api/videos/${slug}`,
|
||||
castData: { apiUrl, slug, clientId, ...(authToken && { token: authToken }) },
|
||||
castData: {
|
||||
apiUrl,
|
||||
slug,
|
||||
clientId,
|
||||
...(authToken && { token: authToken }),
|
||||
// Cast notification metadata for the sender: videojs otherwise loads
|
||||
// an empty GenericMediaMetadata, so the phone/lock-screen notification
|
||||
// falls back to the app/device name. The image must be an absolute,
|
||||
// authed URL to load off-device (thumbnail.high is relative).
|
||||
title: title ?? data?.path ?? "",
|
||||
...(data?.show?.name && { subtitle: data.show.name }),
|
||||
...(data?.show?.thumbnail?.id && {
|
||||
poster: `${apiUrl}/api/images/${data.show.thumbnail.id}?quality=high${
|
||||
authToken ? `&session-token=${authToken}` : ""
|
||||
}`,
|
||||
}),
|
||||
},
|
||||
}),
|
||||
[apiUrl, slug, playMode, info, authToken, start, data, title],
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user