mirror of
https://github.com/MoonTechLab/LunaTV.git
synced 2026-02-22 10:34:42 +08:00
feat: default disable blockad
This commit is contained in:
@@ -132,7 +132,7 @@ Pull Bot 会反复触发无效的 PR 和垃圾邮件,严重干扰项目维护
|
||||
| ----------------------------------- | ---------------------------------- | ---------------------------------------------------------------- | ------------ |
|
||||
| PASSWORD | 实例访问密码,留空则不启用密码保护 | 任意字符串 | (空) |
|
||||
| NEXT_PUBLIC_STORAGE_TYPE | 播放记录/收藏的存储方式 | localstorage(本地浏览器存储)、database(后端数据库,暂不支持) | localstorage |
|
||||
| NEXT_PUBLIC_DISABLE_BLOCKAD | 禁用智能去广告功能 | true / false | false |
|
||||
| NEXT_PUBLIC_ENABLE_BLOCKAD | 开启智能去广告功能(实验性) | true / false | false |
|
||||
| NEXT_PUBLIC_SEARCH_MAX_PAGE | 搜索接口可拉取的最大页数 | 1-50 | 5 |
|
||||
| NEXT_PUBLIC_AGGREGATE_SEARCH_RESULT | 搜索结果默认是否按标题和年份聚合 | true / false | true |
|
||||
|
||||
|
||||
@@ -21,8 +21,7 @@ import { Suspense } from 'react';
|
||||
import { useCallback, useEffect, useRef, useState } from 'react';
|
||||
import React from 'react';
|
||||
|
||||
// 根据环境变量决定是否禁用去广告 Loader,默认 false
|
||||
const DISABLE_BLOCKAD = process.env.NEXT_PUBLIC_DISABLE_BLOCKAD === 'true';
|
||||
const ENABLE_BLOCKAD = process.env.NEXT_PUBLIC_ENABLE_BLOCKAD === 'true';
|
||||
|
||||
import 'vidstack/styles/defaults.css';
|
||||
import '@vidstack/react/player/styles/default/theme.css';
|
||||
@@ -1325,7 +1324,7 @@ function PlayPageClient() {
|
||||
backBufferLength: 30, // 仅保留 30s 已播放内容,避免内存占用
|
||||
maxBufferSize: 60 * 1000 * 1000, // 约 60MB,超出后触发清理
|
||||
/* 自定义loader */
|
||||
loader: DISABLE_BLOCKAD ? Hls.DefaultConfig.loader : CustomHlsJsLoader,
|
||||
loader: ENABLE_BLOCKAD ? CustomHlsJsLoader : Hls.DefaultConfig.loader,
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user