config类型定义中qiniuLiveConfi新增配置添加?
This commit is contained in:
parent
01609d4093
commit
26bda3c197
|
|
@ -9,10 +9,10 @@ export type QiniuLiveConfig = {
|
|||
liveHost: string;
|
||||
hub: string;
|
||||
publishDomain: string;
|
||||
playDomainType: 'rtmp' | 'hls' | 'flv';
|
||||
playDomainType?: 'rtmp' | 'hls' | 'flv';
|
||||
playDomain: string;
|
||||
playBackDomain: string;
|
||||
publishSecurity: 'none' | 'static' | 'expiry' | 'expiry_sk';
|
||||
publishSecurity?: 'none' | 'static' | 'expiry' | 'expiry_sk';
|
||||
publishKey: string;
|
||||
playKey: string;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -9,10 +9,10 @@ export type QiniuLiveConfig = {
|
|||
liveHost: string;
|
||||
hub: string;
|
||||
publishDomain: string;
|
||||
playDomainType: 'rtmp' | 'hls' | 'flv';
|
||||
playDomainType?: 'rtmp' | 'hls' | 'flv';
|
||||
playDomain: string;
|
||||
playBackDomain: string;
|
||||
publishSecurity: 'none' | 'static' | 'expiry' | 'expiry_sk';
|
||||
publishSecurity?: 'none' | 'static' | 'expiry' | 'expiry_sk';
|
||||
publishKey: string;
|
||||
playKey: string;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getPlayBackUrl = exports.getStreamObj = exports.getLivestream = void 0;
|
||||
exports.getLivestream = getLivestream;
|
||||
exports.getStreamObj = getStreamObj;
|
||||
exports.getPlayBackUrl = getPlayBackUrl;
|
||||
const assert_1 = require("oak-domain/lib/utils/assert");
|
||||
const getContextConfig_1 = require("./getContextConfig");
|
||||
/**
|
||||
|
|
@ -27,7 +29,6 @@ async function getLivestream(params, context) {
|
|||
expireAt,
|
||||
};
|
||||
}
|
||||
exports.getLivestream = getLivestream;
|
||||
// 获取推拉流地址
|
||||
/**
|
||||
* 直播流已存在的情况下,获取推拉流地址
|
||||
|
|
@ -52,7 +53,6 @@ async function getStreamObj(params, context) {
|
|||
expireAt,
|
||||
};
|
||||
}
|
||||
exports.getStreamObj = getStreamObj;
|
||||
// 生成直播回放
|
||||
async function getPlayBackUrl(params, context) {
|
||||
const { streamTitle, start, end, origin } = params;
|
||||
|
|
@ -61,4 +61,3 @@ async function getPlayBackUrl(params, context) {
|
|||
const { hub, playBackDomain, liveHost } = config;
|
||||
return instance.getPlayBackUrl(hub, playBackDomain, streamTitle, start, end, 'POST', liveHost);
|
||||
}
|
||||
exports.getPlayBackUrl = getPlayBackUrl;
|
||||
|
|
|
|||
|
|
@ -12,10 +12,10 @@ export type QiniuLiveConfig = {
|
|||
liveHost: string; // 七牛直播云接口域名
|
||||
hub: string; // 直播空间名,
|
||||
publishDomain: string; // 推流域名
|
||||
playDomainType: 'rtmp' | 'hls' | 'flv'; //拉流域名类型
|
||||
playDomainType?: 'rtmp' | 'hls' | 'flv'; //拉流域名类型
|
||||
playDomain: string; // 拉流域名
|
||||
playBackDomain: string; // 直播回放存储域名
|
||||
publishSecurity: 'none' | 'static' | 'expiry' | 'expiry_sk'; //推流鉴权方式:'none':无校验鉴权;'static':静态鉴权;'expiry':限时鉴权;'expiry_sk':限时鉴权sk
|
||||
publishSecurity?: 'none' | 'static' | 'expiry' | 'expiry_sk'; //推流鉴权方式:'none':无校验鉴权;'static':静态鉴权;'expiry':限时鉴权;'expiry_sk':限时鉴权sk
|
||||
publishKey: string; // 直播空间限时鉴权密钥 用于static和expiry类型的推流鉴权方式 expiry_sk使用accessKey和secretKey
|
||||
playKey: string; // 拉流密钥(防盗链主密钥) 若为空则为未开启防盗链
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ export async function getLivestream<ED extends EntityDict & BaseEntityDict, Cxt
|
|||
} = getConfig(context.getApplication()!.system!.config!, 'Live', origin);
|
||||
assert(origin === 'qiniu');
|
||||
const { hub, liveHost, publishDomain, playDomainType, playDomain, playKey, publishKey, publishSecurity } = config as QiniuLiveConfig;
|
||||
const r = await (instance as QiniuCloudInstance).getLiveStream(hub, streamTitle, liveHost, publishDomain, playDomainType, playDomain, expireAt, publishSecurity, publishKey, playKey);
|
||||
const r = await (instance as QiniuCloudInstance).getLiveStream(hub, streamTitle, liveHost, publishDomain, playDomainType!, playDomain, expireAt, publishSecurity!, publishKey, playKey);
|
||||
return {
|
||||
streamTitle,
|
||||
hub,
|
||||
|
|
@ -83,7 +83,7 @@ export async function getStreamObj<ED extends EntityDict & BaseEntityDict, Cxt e
|
|||
|
||||
assert(origin === 'qiniu');
|
||||
const { playDomainType, publishDomain, publishSecurity, publishKey, playDomain, playKey, hub } = config as QiniuLiveConfig;
|
||||
const r = (instance as QiniuCloudInstance).getStreamObj(hub, streamTitle, expireAt, publishDomain, playDomainType, playDomain, publishSecurity, publishKey, playKey);
|
||||
const r = (instance as QiniuCloudInstance).getStreamObj(hub, streamTitle, expireAt, publishDomain, playDomainType!, playDomain, publishSecurity!, publishKey, playKey);
|
||||
return {
|
||||
streamTitle,
|
||||
hub,
|
||||
|
|
|
|||
|
|
@ -118,6 +118,8 @@ export const system: System[] = [
|
|||
publishKey: '',
|
||||
playKey: '',
|
||||
playBackDomain: '',
|
||||
playDomainType: 'rtmp',
|
||||
publishSecurity: 'none',
|
||||
},
|
||||
},
|
||||
Account: {
|
||||
|
|
|
|||
Loading…
Reference in New Issue