... ... @@ -63,7 +63,7 @@ export default class MessageEntrance extends Emiter {
super();
this.lastClassActiveTime=0;//最后一次课堂激活的时间戳
//sdk 信息
GlobalConfig.sdkVersion = "v2.30.2.20171117";
GlobalConfig.sdkVersion = "v2.30.5.20171117";
loger.warn("sdkVersion:" + GlobalConfig.sdkVersion);
console.log("sdkVersion:" + GlobalConfig.sdkVersion);
//设置
... ...
... ... @@ -33,6 +33,11 @@ class RecordInfoMatch extends Emiter {
this.filePath=this.filePath.replace(":8080","");
}
if (!_recordMessagesList||_recordMessagesList.length<1) {
console.log("没有视频消息", _recordMessagesList);
this.matchRecordFile(this.recordMessages, this.m3u8jsonDataList);
}
//this.getRecordInfo(()=> {
this.parseRecordMessage(_recordMessagesList,()=> {
console.log("JSON数据列表",this.jsonPathList);
... ... @@ -65,7 +70,7 @@ class RecordInfoMatch extends Emiter {
creatDate: i,
folder: k,
stream: j,
createTimeUTC: stream
creatTimeUTC: stream
};
}
... ... @@ -118,11 +123,11 @@ class RecordInfoMatch extends Emiter {
//console.log(JSON.stringify(item));
delete item.appId;
delete item.id;
let time = parseInt(item.createTime);
let time = parseInt(item.creatTime);
let timeInfo = this.timestampToUTCTime(time);
//return {yymmddhhmmss:yymmddhhmmss,yymmdd:yymmdd}
item.seek = 0;
item.createTimeUTC = timeInfo.yymmddhhmmss;
item.creatTimeUTC = timeInfo.yymmddhhmmss;
item.creatDate = timeInfo.yymmdd;
this.jsonPathList [timeInfo.yymmdd] = this.filePath + "/" + timeInfo.yymmdd + "/json/" + item.channel + ".json";
item.stream_id = item.channel + "_" + item.userId + "_" + item.timestamp;
... ... @@ -157,19 +162,19 @@ class RecordInfoMatch extends Emiter {
//console.log(JSON.stringify(item));
delete item.appId;
delete item.id;
let time = parseInt(item.createTime);
let time = parseInt(item.creatTime);
let timeInfo = this.timestampToUTCTime(time);
//return {yymmddhhmmss:yymmddhhmmss,yymmdd:yymmdd}
item.seek = 0;
item.createTimeUTC = timeInfo.yymmddhhmmss;
item.creatTimeUTC = timeInfo.yymmddhhmmss;
item.creatDate = timeInfo.yymmdd;
this.jsonPathList [timeInfo.yymmdd] = this.filePath + "/samples/" + timeInfo.yymmdd + "/json/" + item.channel + ".json";
item.stream_id = item.channel + "_" + item.userId + "_" + item.timestamp;
item.stream_id = item.channel + "_" + item.userId + "_" + item.creatTime;
if (!this.recordMessages[item.uid]) {
this.recordMessages[item.uid] = {};
}
this.recordMessages[item.uid][item.timestamp] = item;
this.recordMessages[item.uid][item.creatTime] = item;
}
}
if (_callback) {
... ... @@ -260,10 +265,10 @@ class RecordInfoMatch extends Emiter {
let uidRecordInfoArr = Object.values(uidRecordInfo);
let uidRecordFileArr = Object.values(uidRecordFile);
uidRecordInfoArr = uidRecordInfoArr.sort(function (a, b) {
return parseInt(a.createTimeUTC) - parseInt(b.createTimeUTC);
return parseInt(a.creatTimeUTC) - parseInt(b.creatTimeUTC);
});
uidRecordFileArr = uidRecordFileArr.sort(function (a, b) {
return parseInt(a.createTimeUTC) - parseInt(b.createTimeUTC);
return parseInt(a.creatTimeUTC) - parseInt(b.creatTimeUTC);
});
if (uidRecordInfoArr.length == uidRecordFileArr.length && uidRecordFileArr.length > 0) {
... ... @@ -278,7 +283,7 @@ class RecordInfoMatch extends Emiter {
} else {
//2.通过时间戳匹配
for (let f in uidRecordInfo) {
let time = parseInt(uidRecordInfo[f].createTimeUTC);
let time = parseInt(uidRecordInfo[f].creatTimeUTC);
let video_url = "";
let video_urlObj = uidRecordFile[k + "_" + time];
if (video_urlObj && video_urlObj.video_url) {
... ... @@ -327,7 +332,7 @@ class RecordInfoMatch extends Emiter {
} else {
if (lastFileItem) {
infoItem.video_url = lastFileItem.video_url;
infoItem.seek = parseInt(infoItem.createTimeUTC) - parseInt(lastFileItem.createTimeUTC);
infoItem.seek = parseInt(infoItem.creatTimeUTC) - parseInt(lastFileItem.creatTimeUTC);
if (!this.matchStreams[infoItem.stream_id]) {
this.matchStreams[infoItem.stream_id] = infoItem;
}
... ... @@ -350,7 +355,7 @@ class RecordInfoMatch extends Emiter {
for (let h in uidRecordInfo) {
item2 = uidRecordInfo[h];
if (item2 && item2.video_url) {
let interval = parseInt((item.createTime) * 0.001 - parseInt(item2.createTime) * 0.001);
let interval = parseInt((item.creatTime) * 0.001 - parseInt(item2.creatTime) * 0.001);
if (minInterval > interval) {
nearItem = item2;
minInterval = interval;
... ...
... ... @@ -1086,10 +1086,10 @@ class RecordPlayBackParse extends Emiter {
timestamp: timestamp
};
//this._videoApeBroadcastMssages[timestamp]={parseData:videoReceivePdu,byteData:data,timestamp: timestamp};
if(videoReceivePdu&&videoReceivePdu.data){
/* if(videoReceivePdu&&videoReceivePdu.data){
videoReceivePdu.data.createTime=videoReceivePdu.data.timestamp;
}
this.videoPublishMessages.push(videoReceivePdu.data);
this.videoPublishMessages.push(videoReceivePdu.data);*/
}
} catch (err) {
... ... @@ -1228,6 +1228,19 @@ class RecordPlayBackParse extends Emiter {
statusStr = "开";
this.allStreams[videoChannelInfo.streamId] = videoChannelInfo;
console.log("视频流" + videoChannelInfo.streamId);
if(videoChannelInfo){
videoChannelInfo.channel=videoChannelInfo.siteId+"_"+videoChannelInfo.classId;
videoChannelInfo.uid=videoChannelInfo.fromNodeId;
let streamInfo=videoChannelInfo.streamId.split("_");
//kaifangwebrtc_1092942818_S8908_1510741823354
if(streamInfo&&streamInfo.length>1){
videoChannelInfo.creatTime=streamInfo[streamInfo.length-1];//获取最后的毫秒时间戳
}else {
videoChannelInfo.creatTime=parseInt(videoChannelInfo.timestamp)*1000;//秒转换为毫秒
}
}
this.videoPublishMessages.push(videoChannelInfo);
}
this.mediaChannleList[videoChannelInfo.channelId][timestamp] = {
parseData: videoChannelInfo,
... ...