bonc-htmlplayer
Advanced tools
Comparing version 5.0.14 to 5.0.15
{ | ||
"name": "bonc-htmlplayer", | ||
"version": "5.0.14", | ||
"version": "5.0.15", | ||
"description": "东方国信的html播放器内核", | ||
@@ -5,0 +5,0 @@ "main": "./dist/BoncH5Player.js", |
@@ -6,7 +6,7 @@ import Event from "../../util/event"; | ||
export default class BufferController extends Event { | ||
constructor(sourceBuffer, type, videoNode, mediaSource,canvasOver) { | ||
constructor(sourceBuffer, type, videoNode, mediaSource, canvasOver) { | ||
super("buffer"); | ||
this.type = type; | ||
this.videoNode = videoNode; | ||
this.canvasOverEle=document.getElementById(canvasOver) | ||
this.canvasOverEle = document.getElementById(canvasOver) | ||
this.queue = new Uint8Array(); | ||
@@ -44,7 +44,7 @@ this.cleaning = false; | ||
// } | ||
try{ | ||
try { | ||
if (sourceBuffer.buffered && sourceBuffer.buffered > 0) { | ||
this.rangeStart = sourceBuffer.buffered.end(0); | ||
} | ||
} catch(e){} | ||
} catch (e) { } | ||
@@ -59,8 +59,8 @@ //console.log('updatestart',sourceBuffer.buffered.start(0),arguments[2].currentTime,sourceBuffer.buffered.end(0)) | ||
// } | ||
try{ | ||
try { | ||
if (sourceBuffer.buffered && sourceBuffer.buffered > 0) { | ||
this.rangeEnd = sourceBuffer.buffered.end(0); | ||
} | ||
} catch(e){} | ||
// 张勇 为了处理白矿浏览器崩溃问题内存增产问题 | ||
} catch (e) { } | ||
//张勇为了解决白矿内存溢出 0808 | ||
// this.rangeList.push([this.rangeStart, this.rangeEnd]); | ||
@@ -80,4 +80,4 @@ // console.log([this.rangeStart,this.rangeEnd],arguments[2].currentTime) | ||
this.canvasOver(); | ||
// this.dispatch("error", { | ||
// this.dispatch("error", { | ||
// type: this.type, | ||
@@ -102,3 +102,3 @@ // name: "error", | ||
// console.log(range) | ||
//console.log(`${this.type} 删除多余的 range [${range[0]} - ${range[1]})`); | ||
//console.log(`${this.type} 删除多余的 range [${range[0]} - ${range[1]})`); | ||
this.cleaning = true; | ||
@@ -146,3 +146,4 @@ this.sourceBuffer.remove(range[0], range[1]); | ||
try { | ||
this.queue1=this.queue | ||
//张勇为了解决白矿内存溢出 0809 | ||
// this.queue1=this.queue | ||
// console.log("112-this.queue长度:",this.queue) | ||
@@ -154,4 +155,4 @@ this.sourceBuffer.appendBuffer(this.queue); | ||
} catch (e) { | ||
// console.log("添加buffter错误异常",e, this.type, this.videoNode.id, e.name); | ||
// console.log("异常this.queue:",this.queue) | ||
// console.log("添加buffter错误异常",e, this.type, this.videoNode.id, e.name); | ||
// console.log("异常this.queue:",this.queue) | ||
this.videoNode.addEventListener("error", function (e) { | ||
@@ -172,7 +173,7 @@ // console.log("112-异常-error") | ||
// console.log('异常InvalidStateError',) | ||
// this.dispatch('restart',e.name) | ||
this.canvasOver(); | ||
this.canvasOver(); | ||
// this.sourceBuffer.abort() | ||
// this.dispatch("error", { | ||
@@ -183,7 +184,7 @@ // type: this.type, | ||
// }); | ||
return; | ||
} | ||
// console.log('112-unexpectedError') | ||
this.canvasOver(); | ||
this.canvasOver(); | ||
// this.dispatch("error", { | ||
@@ -203,10 +204,10 @@ // type: this.type, | ||
canvasOver(){ | ||
canvasOver() { | ||
this.videoNode.pause(); | ||
this.canvasOverEle.style.display="block"; | ||
this.canvasOverEle.style.display = "block"; | ||
var context = this.canvasOverEle.getContext('2d'); | ||
context.drawImage(this.videoNode, 0, 0, this.canvasOverEle.width, this.canvasOverEle.height); | ||
this.dispatch('restart',"buffterError") | ||
this.queue = new Uint8Array(); | ||
this.dispatch('restart', "buffterError") | ||
this.queue = new Uint8Array(); | ||
} | ||
} |
@@ -125,3 +125,3 @@ import { extractNALubonc } from "./utils"; | ||
} | ||
//张勇 为了处理白矿浏览器崩溃问题内存增产问题 | ||
//张勇为了解决白矿内存溢出 0808 | ||
// this.currentRange = this.bufferControllers["video"].rangeList.pop(); | ||
@@ -199,5 +199,6 @@ this.timeend = this.app.node.buffered.end(0); | ||
// console.log("当前时间:", new Date().toLocaleString(), "。数据:", data); | ||
if (data.isStart) { | ||
this.startPayload = data.payload; | ||
} | ||
//张勇为了解决白矿内存溢出 0809 | ||
// if (data.isStart) { | ||
// this.startPayload = data.payload; | ||
// } | ||
if (this.bufferControllers && this.bufferControllers[data.type]) { | ||
@@ -323,3 +324,2 @@ // console.log('data.payload:',data.payload) | ||
var nalarr = []; | ||
// console.log('this.nalsboncarr:',this.nalsboncarr) | ||
var nal = this.nalsboncarr.shift(); | ||
@@ -353,3 +353,5 @@ var nalType = nal[0] & 0x1f; | ||
} | ||
//张勇为了解决白矿内存溢出 0809 | ||
this.spsnal = null | ||
this.ppsnal = null | ||
if (this.spspps == false) { | ||
@@ -385,2 +387,6 @@ // console.log(nalType) | ||
this.remuxController.remux(chunks); //将接收到的数据传入此方法并转成mp4片段 | ||
//张勇为了解决白矿内存溢出 0809 | ||
if (this.nalsboncarr.length) { | ||
this.nalsboncarr = [] | ||
} | ||
} | ||
@@ -485,2 +491,3 @@ PlayNalsReverse() { | ||
this.app.node.play(); | ||
//张勇为了解决白矿内存溢出 0808 | ||
this.clearCanvas() | ||
@@ -500,2 +507,3 @@ }) | ||
this.app.node.play(); | ||
//张勇为了解决白矿内存溢出 0808 | ||
this.clearCanvas() | ||
@@ -502,0 +510,0 @@ }) |
@@ -139,3 +139,3 @@ import Event from "./util/event"; | ||
this.on("errorRestart",(data)=>{ | ||
console.log('buffter异常重新实例化',data) | ||
console.log('buffer异常重新实例化',data) | ||
validateConfigs.call(this, this.configs); //对配置项进行验证 | ||
@@ -142,0 +142,0 @@ this._player = new H264Mp4Player(this); |
@@ -260,2 +260,2 @@ export function appendByteArray(buffer1, buffer2) | ||
export const version="5.0.14" | ||
export const version="5.0.15" |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
24437302
53977
13