Authored by 郝肖肖

'live-ctx'

... ... @@ -72,9 +72,14 @@ module.exports = class extends global.yoho.BaseModel {
// 获取精选视频
_getBestList() {
return liveAPI.get('v1/living/best', {}, {
return this.get({
api: liveAPI,
url: 'v1/living/best',
data: {},
param: {
code: 200,
cache: false
}
}).then(result => {
let list = result && result.data || [];
... ... @@ -107,9 +112,14 @@ module.exports = class extends global.yoho.BaseModel {
// 获取直播中所有视频
_getLivingList() {
return liveAPI.get('v1/living/listing', {}, {
return this.get({
api: liveAPI,
url: 'v1/living/listing',
data: {},
param: {
code: 200,
cache: false
}
}).then(result => {
return result && result.data || [];
});
... ... @@ -117,9 +127,14 @@ module.exports = class extends global.yoho.BaseModel {
// 获取直播预告列表
_getPrelivingList() {
return liveAPI.get('v1/living/starting', {}, {
return this.get({
api: liveAPI,
url: 'v1/living/starting',
data: {},
param: {
code: 200,
cache: false
}
}).then(result => {
let list = result && result.data || [];
... ... @@ -132,9 +147,14 @@ module.exports = class extends global.yoho.BaseModel {
// 获取回看列表
_getRecordList() {
return liveAPI.get('v1/living/replaying', {}, {
return this.get({
api: liveAPI,
url: 'v1/living/replaying',
data: {},
param: {
code: 200,
cache: false
}
}).then(result => {
return result && result.data || [];
});
... ... @@ -153,12 +173,16 @@ module.exports = class extends global.yoho.BaseModel {
// 获取 回放视屏 信息
fetchReplayInfo(videoID) {
let url = 'v1/living/detail';
let data = { video_id: videoID };
let options = { cache: true };
return liveAPI.get(url, data, options)
.then(result => {
return this.get({
api: liveAPI,
url: 'v1/living/detail',
data: data,
param: {
cache: true
}
}).then(result => {
if (result && result.data) {
let d = result.data;
... ... @@ -182,10 +206,13 @@ module.exports = class extends global.yoho.BaseModel {
// 获取 直播视屏 信息
fetchLiveInfo(roomID) {
let url = 'v1/living/detail';
let data = { room_id: roomID };
return liveAPI.get(url, data).then(result => {
return this.get({
api: liveAPI,
url: 'v1/living/detail',
data: data
}).then(result => {
if (result && result.data) {
let d = result.data;
... ... @@ -216,18 +243,27 @@ module.exports = class extends global.yoho.BaseModel {
// 获取 直播 弹幕 host
getBarrageHost(type) {
return liveAPI.get('v1/system/gethosts', { type });
return this.get({
api: liveAPI,
url: 'v1/system/gethosts',
data: { type }
});
}
getReplyBarrage(videoID, startTime, timeInterval) {
const url = 'v1/living/getreplaybarrage';
const data = {
startTime,
timeInterval,
video_id: videoID
};
const options = { cache: true };
return liveAPI.get(url, data, options);
return this.get({
api: liveAPI,
url: 'v1/living/getreplaybarrage',
data: data,
param: {
cache: true
}
});
}
};
... ...