mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-06-04 04:58:30 +01:00
feat: share selected playback options to chromecast
This commit is contained in:
@@ -145,6 +145,7 @@ export const PlayButton: React.FC<Props> = ({
|
|||||||
client,
|
client,
|
||||||
item,
|
item,
|
||||||
contentUrl: data.url,
|
contentUrl: data.url,
|
||||||
|
playbackOptions: selectedOptions,
|
||||||
images: [
|
images: [
|
||||||
{
|
{
|
||||||
url: getParentBackdropImageUrl({
|
url: getParentBackdropImageUrl({
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import { SelectedOptions } from "@/components/ItemContent";
|
||||||
import { BaseItemDto } from "@jellyfin/sdk/lib/generated-client";
|
import { BaseItemDto } from "@jellyfin/sdk/lib/generated-client";
|
||||||
import { RemoteMediaClient, WebImage } from "react-native-google-cast";
|
import { RemoteMediaClient, WebImage } from "react-native-google-cast";
|
||||||
|
|
||||||
@@ -6,18 +7,23 @@ export function chromecastLoadMedia({
|
|||||||
item,
|
item,
|
||||||
contentUrl,
|
contentUrl,
|
||||||
images,
|
images,
|
||||||
|
playbackOptions,
|
||||||
}: {
|
}: {
|
||||||
client: RemoteMediaClient;
|
client: RemoteMediaClient;
|
||||||
item: BaseItemDto;
|
item: BaseItemDto;
|
||||||
contentUrl: string;
|
contentUrl: string;
|
||||||
images: WebImage[];
|
images: WebImage[];
|
||||||
|
playbackOptions: SelectedOptions;
|
||||||
}) {
|
}) {
|
||||||
return client.loadMedia({
|
return client.loadMedia({
|
||||||
mediaInfo: {
|
mediaInfo: {
|
||||||
contentId: item.Id,
|
contentId: item.Id,
|
||||||
contentUrl,
|
contentUrl,
|
||||||
contentType: "video/mp4",
|
contentType: "video/mp4",
|
||||||
customData: item,
|
customData: {
|
||||||
|
item,
|
||||||
|
playbackOptions,
|
||||||
|
},
|
||||||
metadata:
|
metadata:
|
||||||
item.Type === "Episode"
|
item.Type === "Episode"
|
||||||
? {
|
? {
|
||||||
|
|||||||
Reference in New Issue
Block a user