mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-06 20:10: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 = [
|
||||
{ audioCodec: 'mp3', container: 'mp3', 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: {
|
||||
audioCodecs: string[];
|
||||
containers: string[];
|
||||
@@ -71,7 +73,7 @@ const DIRECT_PLAY_PROFILES: {
|
||||
}[] = [];
|
||||
|
||||
export function getDefaultTranscodingProfiles() {
|
||||
return DEFAULT_TRANSCODING_PROFILES;
|
||||
return isSafari() ? SAFARI_TRANSCODING_PROFILES : DEFAULT_TRANSCODING_PROFILES;
|
||||
}
|
||||
|
||||
export function getDirectPlayProfiles() {
|
||||
@@ -97,6 +99,11 @@ function detectBrowserProfile() {
|
||||
return DIRECT_PLAY_PROFILES;
|
||||
}
|
||||
|
||||
function isSafari() {
|
||||
const ua = navigator.userAgent;
|
||||
return ua.includes('Safari') && !ua.includes('Chrome') && !ua.includes('Chromium');
|
||||
}
|
||||
|
||||
export const AudioPlayers = () => {
|
||||
const playbackType = usePlaybackType();
|
||||
const serverId = useCurrentServerId();
|
||||
|
||||
Reference in New Issue
Block a user