頻道設定
更新時間:2024-10-10 17:27:10
本文件主要說明 频道模块(channel) 提供的頻道設定相關 API 文件,詳細內容請見下文:
一、觀看頁設定
1.1 取得觀看頁設定
用於取得管理後台設定的觀看頁設定資訊。
Api 方法: getWatchSetting(): ChannelWatchSetting
回傳值說明: 頻道觀看頁設定,ChannelWatchSetting 類型,詳細類型說明如下
| 屬性名 | 說明 | 類型 |
|---|---|---|
watchEnabled |
觀看頁開關 | boolean |
mobileWatchEnabled |
行動端觀看頁開關 | boolean |
splashEnabled |
引導頁開關 | boolean |
範例:
const setting = watchCore.channel.getWatchSetting();
if (!setting.watchEnabled) { alert('当前观看页暂未开放'); }
if (isMobile && !setting.mobileWatchEnabled) { alert('暂不支持移动端观看'); }
二、頁面佈局
2.1 取得頻道佈局設定
用於取得管理後台的頁面佈局相關設定。
Api 方法: getLayoutSetting(): ChannelLayoutSetting
回傳值說明: 頻道佈局設定,ChannelLayoutSetting 類型,詳細類型說明如下
| 屬性名 | 說明 | 類型 |
|---|---|---|
mainScreenLayoutMode |
三分屏主螢幕佈局模式 | MainScreenLayoutMode |
mobileSplashLayout |
行動端引導頁佈局 | MobileSplashLayout |
mobileWatchLayout |
行動端觀看頁佈局 | MobileWatchLayout |
範例:
const setting = watchCore.channel.getLayoutSetting();
console.log('三分屏主屏布局模式:', setting.mainScreenLayoutMode);
console.log('移动端引导页布局:', setting.mobileSplashLayout);
console.log('移动端观看页页布局:', setting.mobileWatchLayout);
三、皮膚主題
3.1 取得頻道皮膚主題設定
用於取得管理後台的皮膚主題設定。
Api 方法: getThemeSetting(): ChannelThemeSetting
回傳值說明: 頻道皮膚主題設定,ChannelThemeSetting 類型,詳細類型說明如下
| 屬性名 | 說明 | 類型 |
|---|---|---|
pageSkin |
觀看頁皮膚 | ChannelWatchPageSkin |
browserFavIcon |
瀏覽器標籤頁圖示 | undefined | string |
channelCoverImg |
頻道圖示圖片位址 | string |
splashImg |
引導頁封面圖 | undefined | string |
mobileSplashLargeImg |
行動端引導頁大圖 | undefined | string |
pcWatchBackgroundImage |
PC 端觀看頁背景圖 | undefined | string |
mobileChatBackgroundImage |
行動端聊天室背景圖 | undefined | string |
mobileChatBackgroundImageAmbiguity |
聊天室背景圖模糊,0 ~ 100 | undefined | number |
portraitBackgroundImage |
直式背景圖 | undefined | string |
portraitBackgroundImageAmbiguity |
直式背景圖透明度,0 ~ 100 | undefined | number |
範例:
const setting = watchCore.channel.getThemeSetting();
console.log('皮肤风格:', setting.pageSkin);
console.log('直播间图标:', setting.channelCoverImg);
