bonc-htmlplayer
Advanced tools
Comparing version 1.0.8 to 1.0.9
{ | ||
"name": "bonc-htmlplayer", | ||
"version": "1.0.8", | ||
"version": "1.0.9", | ||
"description": "东方国信的html播放器内核", | ||
@@ -5,0 +5,0 @@ "main": "./src/index.js", |
@@ -1,4 +0,3 @@ | ||
[TOC] | ||
# BonchH5Player 播放器内核接口文档 | ||
# BoncH5Player 播放器内核接口文档 | ||
@@ -5,0 +4,0 @@ ## 描述 |
@@ -184,2 +184,3 @@ import Event from './util/event'; | ||
this.webSocketController.boncws.normalClose(reason); | ||
clearInterval(this.webSocketController.heartLiveInterval) | ||
// this.H264Mp4Player.destroy(); | ||
@@ -322,3 +323,6 @@ this.node.src = ''; | ||
/**切换视频 */ | ||
/** | ||
* 切换视频 | ||
* @param {*} jsonbonc | ||
*/ | ||
changeVideo(jsonbonc){ | ||
@@ -330,2 +334,5 @@ // debugger | ||
// changeVideo(jsonbonc){ | ||
@@ -332,0 +339,0 @@ // var playBody=BLoadXML(xmlPlayBody); |
@@ -1,2 +0,2 @@ | ||
import {xmlHeader,xmlHeartBody} from './orderList'; | ||
import {xmlHeader,xmlHeartBody,xmlCloseBody} from './orderList'; | ||
import ByteArray from './ByteArray'; | ||
@@ -192,4 +192,2 @@ import {ByteLengthOf,MergeBuffer} from './utils' | ||
this.boncws.closeReason ='' | ||
//终止心跳发送 | ||
clearInterval(this.heartLiveInterval) | ||
//事件解绑定 | ||
@@ -264,2 +262,19 @@ this.boncws.removeEventListener('open',this.WebSocketOpen.bind(this)); | ||
closeWebSocket(){ | ||
var strxml= xmlHeader + xmlCloseBody; | ||
var mun=ByteLengthOf(strxml); | ||
var ab=new ArrayBuffer((mun+28)); | ||
var sendBA= new ByteArray(ab); | ||
//写入28个字节头 | ||
sendBA.WriteUint32(0x0100);//版本号(ver): | ||
sendBA.WriteString('BST ');//公司必须是4个字节所以加个空格,服务器限制公司名bst | ||
sendBA.WriteUint32(0x000005DE);//消息类型(msgtype):保活指令: | ||
sendBA.WriteUint32(0x00000000);//指令类型 | ||
sendBA.WriteUint32(mun);//指令长度 | ||
sendBA.WriteUint32(mun+28);//数据全长 | ||
sendBA.WriteUint32(0x00000000);//保留字段 | ||
//写入xml字符串 | ||
sendBA.WriteString(strxml); | ||
this.boncws.send(sendBA.GetArrayBuffer()); | ||
} | ||
@@ -273,3 +288,4 @@ | ||
this.heartLiveInterval = setInterval(()=> | ||
{ | ||
{ | ||
console.log('websocket state',this.boncws.readyState) | ||
var strxml= xmlHeader + xmlHeartBody; | ||
@@ -276,0 +292,0 @@ var mun=ByteLengthOf(strxml); |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
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
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
2458186
38
4442
147