mirror of
https://github.com/streamyfin/streamyfin.git
synced 2025-08-20 18:37:18 +02:00
Merge branch 'feat/audio-select'
This commit is contained in:
@@ -14,6 +14,8 @@ export const getStreamUrl = async ({
|
||||
maxStreamingBitrate,
|
||||
sessionData,
|
||||
deviceProfile = ios12,
|
||||
audioStreamIndex = 0,
|
||||
subtitleStreamIndex = 0,
|
||||
}: {
|
||||
api: Api | null | undefined;
|
||||
item: BaseItemDto | null | undefined;
|
||||
@@ -22,6 +24,8 @@ export const getStreamUrl = async ({
|
||||
maxStreamingBitrate?: number;
|
||||
sessionData: PlaybackInfoResponse;
|
||||
deviceProfile: any;
|
||||
audioStreamIndex?: number;
|
||||
subtitleStreamIndex?: number;
|
||||
}) => {
|
||||
if (!api || !userId || !item?.Id) {
|
||||
return null;
|
||||
@@ -40,6 +44,8 @@ export const getStreamUrl = async ({
|
||||
AutoOpenLiveStream: true,
|
||||
MediaSourceId: itemId,
|
||||
AllowVideoStreamCopy: maxStreamingBitrate ? false : true,
|
||||
AudioStreamIndex: audioStreamIndex,
|
||||
SubtitleStreamIndex: subtitleStreamIndex,
|
||||
},
|
||||
{
|
||||
headers: {
|
||||
|
||||
7
utils/textTools.ts
Normal file
7
utils/textTools.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
/*
|
||||
* Truncate a text longer than a certain length
|
||||
*/
|
||||
export const tc = (text: string | null | undefined, length: number = 20) => {
|
||||
if (!text) return "";
|
||||
return text.length > length ? text.substr(0, length) + "..." : text;
|
||||
};
|
||||
Reference in New Issue
Block a user