修正NEXT_PUBLIC的读取
This commit is contained in:
@@ -27,6 +27,7 @@ export async function GET(request: NextRequest) {
|
|||||||
StorageType: 'localstorage',
|
StorageType: 'localstorage',
|
||||||
Version: CURRENT_VERSION,
|
Version: CURRENT_VERSION,
|
||||||
WatchRoom: watchRoomConfig,
|
WatchRoom: watchRoomConfig,
|
||||||
|
EnableOfflineDownload: process.env.NEXT_PUBLIC_ENABLE_OFFLINE_DOWNLOAD === 'true',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -37,6 +38,7 @@ export async function GET(request: NextRequest) {
|
|||||||
StorageType: storageType,
|
StorageType: storageType,
|
||||||
Version: CURRENT_VERSION,
|
Version: CURRENT_VERSION,
|
||||||
WatchRoom: watchRoomConfig,
|
WatchRoom: watchRoomConfig,
|
||||||
|
EnableOfflineDownload: process.env.NEXT_PUBLIC_ENABLE_OFFLINE_DOWNLOAD === 'true',
|
||||||
EnableRegistration: config.SiteConfig.EnableRegistration || false,
|
EnableRegistration: config.SiteConfig.EnableRegistration || false,
|
||||||
RegistrationRequireTurnstile: config.SiteConfig.RegistrationRequireTurnstile || false,
|
RegistrationRequireTurnstile: config.SiteConfig.RegistrationRequireTurnstile || false,
|
||||||
LoginRequireTurnstile: config.SiteConfig.LoginRequireTurnstile || false,
|
LoginRequireTurnstile: config.SiteConfig.LoginRequireTurnstile || false,
|
||||||
|
|||||||
@@ -101,6 +101,8 @@ export default async function RootLayout({
|
|||||||
FLUID_SEARCH: fluidSearch,
|
FLUID_SEARCH: fluidSearch,
|
||||||
EnableComments: enableComments,
|
EnableComments: enableComments,
|
||||||
ENABLE_TVBOX_SUBSCRIBE: process.env.ENABLE_TVBOX_SUBSCRIBE === 'true',
|
ENABLE_TVBOX_SUBSCRIBE: process.env.ENABLE_TVBOX_SUBSCRIBE === 'true',
|
||||||
|
ENABLE_OFFLINE_DOWNLOAD: process.env.NEXT_PUBLIC_ENABLE_OFFLINE_DOWNLOAD === 'true',
|
||||||
|
VOICE_CHAT_STRATEGY: process.env.NEXT_PUBLIC_VOICE_CHAT_STRATEGY || 'webrtc-fallback',
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ function PlayPageClient() {
|
|||||||
|
|
||||||
// 离线下载功能配置
|
// 离线下载功能配置
|
||||||
const enableOfflineDownload = typeof window !== 'undefined'
|
const enableOfflineDownload = typeof window !== 'undefined'
|
||||||
? process.env.NEXT_PUBLIC_ENABLE_OFFLINE_DOWNLOAD === 'true'
|
? (window as any).RUNTIME_CONFIG?.ENABLE_OFFLINE_DOWNLOAD || false
|
||||||
: false;
|
: false;
|
||||||
const hasOfflinePermission = authInfo?.role === 'owner' || authInfo?.role === 'admin';
|
const hasOfflinePermission = authInfo?.role === 'owner' || authInfo?.role === 'admin';
|
||||||
|
|
||||||
@@ -3471,8 +3471,8 @@ function PlayPageClient() {
|
|||||||
// 如果在 PWA 模式下,直接使用容器全屏(可以隐藏状态栏)
|
// 如果在 PWA 模式下,直接使用容器全屏(可以隐藏状态栏)
|
||||||
if (isPWA) {
|
if (isPWA) {
|
||||||
const container = artPlayerRef.current.template.$container;
|
const container = artPlayerRef.current.template.$container;
|
||||||
if (container && container.requestFullscreen) {
|
if (container && container.webkitEnterFullscreen) {
|
||||||
container.requestFullscreen().catch((err: Error) => {
|
container.webkitEnterFullscreen().catch((err: Error) => {
|
||||||
console.error('PWA 全屏失败:', err);
|
console.error('PWA 全屏失败:', err);
|
||||||
// 如果失败,降级使用网页全屏
|
// 如果失败,降级使用网页全屏
|
||||||
artPlayerRef.current.fullscreenWeb = true;
|
artPlayerRef.current.fullscreenWeb = true;
|
||||||
|
|||||||
@@ -537,7 +537,7 @@ export const UserMenu: React.FC = () => {
|
|||||||
const showOfflineDownload =
|
const showOfflineDownload =
|
||||||
(authInfo?.role === 'owner' || authInfo?.role === 'admin') &&
|
(authInfo?.role === 'owner' || authInfo?.role === 'admin') &&
|
||||||
typeof window !== 'undefined' &&
|
typeof window !== 'undefined' &&
|
||||||
process.env.NEXT_PUBLIC_ENABLE_OFFLINE_DOWNLOAD === 'true';
|
(window as any).RUNTIME_CONFIG?.ENABLE_OFFLINE_DOWNLOAD === true;
|
||||||
|
|
||||||
// 检查是否显示修改密码按钮
|
// 检查是否显示修改密码按钮
|
||||||
const showChangePassword =
|
const showChangePassword =
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ type VoiceStrategy = 'webrtc-fallback' | 'server-only';
|
|||||||
// 获取语音聊天策略配置
|
// 获取语音聊天策略配置
|
||||||
function getVoiceStrategy(): VoiceStrategy {
|
function getVoiceStrategy(): VoiceStrategy {
|
||||||
if (typeof window === 'undefined') return 'webrtc-fallback';
|
if (typeof window === 'undefined') return 'webrtc-fallback';
|
||||||
const strategy = process.env.NEXT_PUBLIC_VOICE_CHAT_STRATEGY || 'webrtc-fallback';
|
const strategy = (window as any).RUNTIME_CONFIG?.VOICE_CHAT_STRATEGY || 'webrtc-fallback';
|
||||||
return strategy as VoiceStrategy;
|
return strategy as VoiceStrategy;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user