Socket
Socket
Sign inDemoInstall

bonc-htmlplayer

Package Overview
Dependencies
Maintainers
5
Versions
70
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bonc-htmlplayer - npm Package Compare versions

Comparing version 5.0.16 to 5.0.17

2

package.json
{
"name": "bonc-htmlplayer",
"version": "5.0.16",
"version": "5.0.17",
"description": "东方国信的html播放器内核",

@@ -5,0 +5,0 @@ "main": "./dist/BoncH5Player.js",

@@ -141,3 +141,3 @@ import Event from "../../util/event";

try {
//张勇为了解决白矿内存溢出 0809
//张勇为了解决白矿内存溢出 0810
// this.queue1=this.queue

@@ -144,0 +144,0 @@ // console.log("112-this.queue长度:",this.queue)

@@ -322,67 +322,66 @@ import { extractNALubonc } from "./utils";

var nalarr = [];
var nal = this.nalsboncarr.shift();
var nalType = nal[0] & 0x1f;
// if(nalType>=13){
// console.log('nalType扔掉的==',nalType)
// return true;
// }
// console.log('nalType==',nalType);
if (this.spspps === false) {
if (nalType == 7) {
this.spsnal = nal;
// console.log('找到sps=',nalType);
return;
} else if (nalType == 8) {
this.ppsnal = nal;
// console.log('找到pps=',nalType);
return;
//张勇为了解决白矿内存溢出 0811
while (this.nalsboncarr.length > 0) {
var nal = this.nalsboncarr.shift();
var nalType = nal[0] & 0x1f;
// if(nalType>=13){
// console.log('nalType扔掉的==',nalType)
// return true;
// }
// console.log('nalType==',nalType);
if (this.spspps === false) {
if (nalType == 7) {
this.spsnal = nal;
// console.log('找到sps=',nalType);
return;
} else if (nalType == 8) {
this.ppsnal = nal;
// console.log('找到pps=',nalType);
return;
}
else if (nalType == 6) {
// console.log("找到6")
return;
}
if (this.spsnal != null && this.ppsnal != null) {
nalarr.push(this.spsnal);
nalarr.push(this.ppsnal);
nalarr.push(nal);
this.spspps = true;
}
if (this.spspps == false) {
// console.log(nalType)
return;
}
//张勇为了解决白矿内存溢出 0809
this.spsnal = null
this.ppsnal = null
} else {
if (nalType != 7 && nalType != 8) {
nalarr.push(nal); // 过滤出不是pps和sps的帧
}
}
else if (nalType == 6) {
// console.log("找到6")
return;
let chunks = {
video: [],
audio: []
};
if (this.nalsbonAudioarr.length > 0) {
// debugger
let arr = [];
arr.push(this.nalsbonAudioarr.shift());
chunks.audio = arr;
this.remuxController.hasAudio = true;
}
if (this.spsnal != null && this.ppsnal != null) {
nalarr.push(this.spsnal);
nalarr.push(this.ppsnal);
nalarr.push(nal);
this.spspps = true;
}
//张勇为了解决白矿内存溢出 0809
this.spsnal = null
this.ppsnal = null
if (this.spspps == false) {
// console.log(nalType)
// console.log('nalarr',nalarr.length)
chunks.video = this.getVideoFrames(nalarr, 0);
if (chunks.video.length === 0) {
return;
}
} else {
if (nalType != 7 && nalType != 8) {
nalarr.push(nal); // 过滤出不是pps和sps的帧
}
// debugger;
this.remuxController.remux(chunks); //将接收到的数据传入此方法并转成mp4片段
}
let chunks = {
video: [],
audio: []
};
if (this.nalsbonAudioarr.length > 0) {
// debugger
let arr = [];
arr.push(this.nalsbonAudioarr.shift());
chunks.audio = arr;
this.remuxController.hasAudio = true;
}
// console.log('nalarr',nalarr.length)
chunks.video = this.getVideoFrames(nalarr, 0);
if (chunks.video.length === 0) {
return;
}
// debugger;
this.remuxController.remux(chunks); //将接收到的数据传入此方法并转成mp4片段
//张勇为了解决白矿内存溢出 0809
if (this.nalsboncarr.length) {
this.nalsboncarr = []
}
}

@@ -461,3 +460,3 @@ PlayNalsReverse() {

clearBuffer() {
// console.log(this.app.node.id,'视频开始播放了',)

@@ -649,3 +648,3 @@

naluObj = new NALU(nalu);
// naluObj.type() != 1 ? console.log('帧类型=' + naluObj.type()) : "";
naluObj.type() != 1 ? console.log('帧类型=' + naluObj.type()) : "";
units.push(naluObj);

@@ -652,0 +651,0 @@ // NALU.IDR 5关键帧 NALU.NDR 1非关键帧

@@ -43,3 +43,2 @@ /**

this.nalsboncarr.push(buffer.subarray(lastIndex, i - state -1));
// console.log('lastIndex')
}

@@ -58,5 +57,3 @@ lastIndex = i;

}
if (lastIndex) {
// console.log('lastIndex2')
this.nalsboncarr.push(buffer.subarray(lastIndex, length));

@@ -63,0 +60,0 @@ }

@@ -13,7 +13,8 @@ /*

let moduleBaseURL = '';
//以下代码是全局加载wasm和ffmpegjs的 start wuyage edit 20221109
self.Module = {
locateFile: function (wasm) {
return `/h265Page/${wasm}`;
},
return moduleBaseURL + `/h265Page/${wasm}`;
},
};

@@ -45,2 +46,6 @@ let globalLibffmpegStatus = 0;

this.webglworker = {}; //渲染线程
//h265 的全局脚本加载 修改
if (moduleBaseURL && !this.option.keepModuleBaseURL) {
this.setModuleBaseURL(this.option.baseURL);
}
this.createScriptNode();

@@ -74,2 +79,6 @@ if (audioNode) {

setModuleBaseURL(url) {
moduleBaseURL = url || '';
}
//创建解码子线程

@@ -76,0 +85,0 @@ createDecoderWorker() {

@@ -139,3 +139,3 @@ import Event from "./util/event";

this.on("errorRestart",(data)=>{
console.log('buffer异常重新实例化',data)
console.log('buffer异常重新实例化')
//张勇为了解决白矿内存溢出 0810

@@ -148,3 +148,3 @@ this._player && this._player.destroy()

makePlayer(codetype) {
// console.log(`视频编码格式:${codetype}`);
console.log(`视频编码格式:${codetype}`);
switch (codetype) {

@@ -156,2 +156,3 @@ case "H265":

let currentIndex = canvasIdIndex.split("_")[1]; //wuyage 1114 add 多路h265
console.log('h265',this.configs)
this._h265player = new H265CanvasPlayer(

@@ -430,3 +431,3 @@ this,

}
// console.log('发送给c端的XML:',Xml2String(playBody))
console.log('发送给c端的XML:',Xml2String(playBody))
this.webSocketController.xmlPlayBody = Xml2String(playBody);

@@ -433,0 +434,0 @@ this.webSocketController.WebSocketInit();

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc