mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-07 04:20:12 +02:00
revert default transcoding profile to opus, add safari check for mp3
This commit is contained in:
@@ -60,10 +60,12 @@ const CODEC_PROBES = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
const DEFAULT_TRANSCODING_PROFILES = [
|
const DEFAULT_TRANSCODING_PROFILES = [
|
||||||
{ audioCodec: 'mp3', container: 'mp3', protocol: 'http' },
|
|
||||||
{ audioCodec: 'opus', container: 'ogg', protocol: 'http' },
|
{ audioCodec: 'opus', container: 'ogg', protocol: 'http' },
|
||||||
|
{ audioCodec: 'mp3', container: 'mp3', protocol: 'http' },
|
||||||
];
|
];
|
||||||
|
|
||||||
|
const SAFARI_TRANSCODING_PROFILES = [{ audioCodec: 'mp3', container: 'mp3', protocol: 'http' }];
|
||||||
|
|
||||||
const DIRECT_PLAY_PROFILES: {
|
const DIRECT_PLAY_PROFILES: {
|
||||||
audioCodecs: string[];
|
audioCodecs: string[];
|
||||||
containers: string[];
|
containers: string[];
|
||||||
@@ -71,7 +73,7 @@ const DIRECT_PLAY_PROFILES: {
|
|||||||
}[] = [];
|
}[] = [];
|
||||||
|
|
||||||
export function getDefaultTranscodingProfiles() {
|
export function getDefaultTranscodingProfiles() {
|
||||||
return DEFAULT_TRANSCODING_PROFILES;
|
return isSafari() ? SAFARI_TRANSCODING_PROFILES : DEFAULT_TRANSCODING_PROFILES;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getDirectPlayProfiles() {
|
export function getDirectPlayProfiles() {
|
||||||
@@ -97,6 +99,11 @@ function detectBrowserProfile() {
|
|||||||
return DIRECT_PLAY_PROFILES;
|
return DIRECT_PLAY_PROFILES;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function isSafari() {
|
||||||
|
const ua = navigator.userAgent;
|
||||||
|
return ua.includes('Safari') && !ua.includes('Chrome') && !ua.includes('Chromium');
|
||||||
|
}
|
||||||
|
|
||||||
export const AudioPlayers = () => {
|
export const AudioPlayers = () => {
|
||||||
const playbackType = usePlaybackType();
|
const playbackType = usePlaybackType();
|
||||||
const serverId = useCurrentServerId();
|
const serverId = useCurrentServerId();
|
||||||
|
|||||||
Reference in New Issue
Block a user