支持播放视频监控

This commit is contained in:
wuxw 2024-07-20 03:05:23 +08:00
parent 842e3305c8
commit 49aaf8e788
12 changed files with 928 additions and 158 deletions

View File

@ -0,0 +1,44 @@
<div class="modal fade" id="selectVideoMachineModel" role="dialog" aria-labelledby="exampleModalLabel"
aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-body">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
<div class="row">
<div class="col-md-6 border-right padding-0">
<div class="text-center">
<vc:i18n name="监控区域" namespace="selectVideoMachine"></vc:i18n>
</div>
<div class="padding-left staff padding padding-top-xs">
<div class=" padding overflow-hidden"
:class="{'select':selectVideoMachineInfo.maId == item.maId}"
v-for="(item,index) in selectVideoMachineInfo.areas" @click="_changeArea(item)"
style="cursor:pointer">
<div>
{{item.maName}}
</div>
</div>
</div>
</div>
<div class="col-md-6 padding-0">
<div class="text-center">
<vc:i18n name="摄像头" namespace="selectVideoMachine"></vc:i18n>
</div>
<div class="padding-left staff padding padding-top-xs">
<div class=" padding overflow-hidden"
:class="{'select':selectVideoMachineInfo.machineId == item.machineId}"
v-for="(item,index) in selectVideoMachineInfo.machines" @click="_changeMachine(item)"
style="cursor:pointer">
<div>
{{item.machineName}}
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,100 @@
(function (vc) {
var default_row = 50;
vc.extends({
data: {
selectVideoMachineInfo: {
areas: [],
machines: [],
maId: '',
machineId: '',
curMachine: {}
}
},
_initMethod: function () {
},
_initEvent: function () {
vc.on('selectVideoMachine', 'openSelectVideo', function (_machine) {
//查询公司信息
$that._clearSelectVideoMachine();
$('#selectVideoMachineModel').modal('show');
$that.selectVideoMachineInfo.curMachine = _machine;
$that._loadSelectAreas();
});
vc.on('selectVideoMachine', 'switchOrg', function (_param) {
$that.loadStaff(_param);
})
},
methods: {
_loadSelectAreas: function () {
let param = {
params: {
page: 1,
row: 100,
communityId: vc.getCurrentCommunity().communityId,
iotApiCode:'listMonitorAreaBmoImpl'
}
};
//发送get请求
vc.http.apiGet('/iot.getOpenApi',
param,
function (json) {
let _data = JSON.parse(json);
$that.selectVideoMachineInfo.areas = _data.data;
if (_data.data.length < 1) {
return;
}
$that._changeArea(_data.data[0])
},
function () {
console.log('请求失败处理');
}
);
},
_loadSelectVideoMachines: function () {
let param = {
params: {
page: 1,
row: 100,
communityId: vc.getCurrentCommunity().communityId,
maId: $that.selectVideoMachineInfo.maId,
iotApiCode:'listMonitorMachineBmoImpl'
}
};
//发送get请求
vc.http.apiGet('/iot.getOpenApi',
param,
function (json) {
let _data = JSON.parse(json);
$that.selectVideoMachineInfo.machines = _data.data;
},
function () {
console.log('请求失败处理');
}
);
},
_changeArea: function (_area) {
$that.selectVideoMachineInfo.maId = _area.maId;
$that._loadSelectVideoMachines();
},
_changeMachine: function (_machine) {
$that.selectVideoMachineInfo.machineId = _machine.machineId;
$that.selectVideoMachineInfo.curMachine.callback(_machine);
$that._clearSelectVideoMachine();
$('#selectVideoMachineModel').modal('hide');
},
_clearSelectVideoMachine: function () {
$that.selectVideoMachineInfo = {
areas: [],
machines: [],
maId: '',
machineId: '',
curMachine: {}
}
}
}
});
})(window.vc);

View File

@ -2,23 +2,20 @@
<div class="row">
<div class="col-md-6">
<h6>
<vc:i18n name="我的摄像头" namespace="cameraControlVideo"></vc:i18n>
<vc:i18n name="摄像头" namespace="cameraControlVideo"></vc:i18n>
</h6>
</div>
<div class="col-md-6 text-right">
<button type="button" class="btn-white btn btn-sm margin-right-sm" v-on:click="_changeCameras()">
<vc:i18n name="摄像头" namespace="cameraControlVideo"></vc:i18n>
</button>
<div class="btn-group" role="group" aria-label="Basic example">
<button type="button" class="btn btn-light btn-sm"
<button type="button" class="btn btn-sm"
v-bind:class="{'btn-primary': cameraControlVideoInfo.cameraCount == 4}"
v-on:click="_changeCount(4)">
<vc:i18n name="四路" namespace="cameraControlVideo"></vc:i18n>
</button>
<button type="button" class="btn btn-light btn-sm"
<button type="button" class="btn btn-sm"
v-bind:class="{'btn-primary': cameraControlVideoInfo.cameraCount == 6}"
v-on:click="_changeCount(6)">
<vc:i18n name="六路" namespace="cameraControlVideo"></vc:i18n>
<vc:i18n name="六路" namespace="cameraControlVideo"></vc:i18n>
</button>
</div>
</div>
@ -28,24 +25,38 @@
<div class="col-md-6" v-if="cameraControlVideoInfo.cameraCount == 4"
v-for="(item,index) in cameraControlVideoInfo.machines">
<div class="form-group">
<video :id="item.machineId" controls autoplay="autoplay" muted width="100%" height="400px"
style="background-color: #000;"></video>
<span><span>
<vc:i18n name="摄像头" namespace="cameraControlVideo"></vc:i18n>
</span>{{item.machineName}}</span>
<div :id="item.id" style="border: 1px solid #dee2e6;">
<img width="100%" src="/img/init.jpg" height="300px" style="border: 1;" />
</div>
<div class="flex justify-between margin-top-sm" style="font-size: 14px;">
<div class="margin-left-sm ">
<span class="fa fa-bell" style="color: #007bff;"></span>{{item.machineName}}
</div>
<button type="button" class="btn btn-sm btn-primary" v-on:click="_openSelectVideo(item)">
选择
</button>
</div>
</div>
</div>
<div class="col-md-4" v-if="cameraControlVideoInfo.cameraCount == 6"
v-for="(item,index) in cameraControlVideoInfo.machines">
<div class="form-group">
<video :id="item.machineId" controls autoplay="autoplay" muted width="100%" height="400px"
style="background-color: #000;"></video>
<span><span>
<vc:i18n name="摄像头" namespace="cameraControlVideo"></vc:i18n>
</span>{{item.machineName}}</span>
<div :id="item.id" style="border: 1px solid #dee2e6;">
<img width="100%" src="/img/init.jpg" height="300px" style="border: 1;" />
</div>
<div class="flex justify-between margin-top-sm" style="font-size: 14px;">
<div class="margin-left-sm ">
<span class="fa fa-bell" style="color: #007bff;"></span>{{item.machineName}}
</div>
<button type="button" class="btn btn-sm btn-primary" v-on:click="_openSelectVideo(item)">
选择
</button>
</div>
</div>
</div>
</div>
<vc:create path="property/chooseCamera"></vc:create>
<vc:create path="machine/selectVideoMachine"></vc:create>
</div>

View File

@ -1,168 +1,99 @@
/**
入驻小区
**/
(function(vc) {
(function (vc) {
var DEFAULT_PAGE = 1;
var DEFAULT_ROWS = 1;
vc.extends({
data: {
cameraControlVideoInfo: {
paId: '',
machines: [],
allMachines: [],
cameraCount: 4
}
},
_initMethod: function() {
_initMethod: function () {
let _cameraCount = vc.getParam('cameraCount');
if (_cameraCount) {
$that.cameraControlVideoInfo.cameraCount = _cameraCount;
}
$that._listMachines(1, 500);
$that._initMachineVideo();
$that._initCamera();
},
_initEvent: function() {
vc.on('cameraControlVideo', 'notify', function(param) {
_initEvent: function () {
vc.on('cameraControlVideo', 'notify', function (param) {
$that.cameraControlVideoInfo.machines = param.machines;
$that.applyViewCamera(_item);
})
vc.on('pagination', 'page_event', function(_currentPage) {
vc.component._listMachines(_currentPage, DEFAULT_ROWS);
});
vc.on('cameraControlInfo', 'page_event', function(_currentPage) {
vc.component._listMachines(_currentPage, DEFAULT_ROWS);
});
},
methods: {
_listMachines: function(_page, _rows) {
let param = {
params: {
page: _page,
row: _rows,
machineTypeCd: '9998',
communityId: vc.getCurrentCommunity().communityId
}
}
//发送get请求
vc.http.apiGet('/machine.listMachines',
param,
function(json, res) {
let _machineManageInfo = JSON.parse(json);
$that.cameraControlVideoInfo.allMachines = _machineManageInfo.machines;
$that.viewCameras();
},
function(errInfo, error) {
console.log('请求失败处理');
}
);
},
_initMachineVideo: function(_machines) {
setInterval(function() {
$that.heartbeatCamera();
}, 1000 * 30)
},
_playVideo: function(_videoId, url) {
$('#' + _videoId).show();
let sdk = null; // Global handler to do cleanup when replaying.
sdk = new SrsRtcPlayerAsync();
$('#' + _videoId).prop('srcObject', sdk.stream);
sdk.play(url).then(function(session) {}).catch(function(reason) {
sdk.close();
$('#' + _videoId).hide();
console.error(reason);
});
},
viewCameras: function() {
let _allMachines = $that.cameraControlVideoInfo.allMachines;
if (!_allMachines || _allMachines.length < 1) {
return;
}
$that.cameraControlVideoInfo.machines = [];
for (let _machineIndex = 0; _machineIndex < _allMachines.length; _machineIndex++) {
if (_machineIndex >= parseInt($that.cameraControlVideoInfo.cameraCount)) {
break;
}
let _item = _allMachines[_machineIndex];
$that.cameraControlVideoInfo.machines.push(_item);
$that.applyViewCamera(_item);
}
},
_changeCameras: function() {
vc.emit('chooseCamera', 'openChooseCameraModel', {
machines: $that.cameraControlVideoInfo.machines,
cameraCount: $that.cameraControlVideoInfo.cameraCount
});
},
applyViewCamera: function(_machine) {
let data = {
machineId: _machine.machineId,
communityId: vc.getCurrentCommunity().communityId,
}
vc.http.apiPost(
'/machine.playCamera',
JSON.stringify(data), {
emulateJSON: true
},
function(json, res) {
//vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
let _json = JSON.parse(json);
if (_json.code == 0) {
$that._playVideo(_machine.machineId, _json.data.address);
_machine.callId = _json.data.callId
return;
}
vc.toast(_json.msg);
},
function(errInfo, error) {
console.log('请求失败处理');
vc.message(json);
_initCamera: function () {
let _machines = [];
let _cameraCount = $that.cameraControlVideoInfo.cameraCount;
for (let i = 0; i < _cameraCount; i++) {
_machines.push({
id: 'cameraVideo' + (i + 1) + 'Div',
machineName: '',
url: ''
});
}
$that.cameraControlVideoInfo.machines = _machines;
},
heartbeatCamera: function(_machine) {
let _machines = $that.cameraControlVideoInfo.machines;
if (!_machines || _machines.length < 1) {
return;
}
_openSelectVideo: function (_item) {
_item.callback = function (_machine) {
console.log(_machine);
_item.machineName = _machine.machineName;
let _callIds = "";
_machines.forEach(item => {
if (item.callId) {
_callIds += (item.callId + ",")
}
});
if (_item.jessibuca) {
try {
_item.jessibuca.destroy();
} catch (err) {
if (!_callIds) {
return;
}
let data = {
callIds: _callIds,
communityId: vc.getCurrentCommunity().communityId,
machineId: _machines[0].machineId
}
vc.http.apiPost(
'/machine.heartbeatCamera',
JSON.stringify(data), {
emulateJSON: true
},
function(json, res) {
//vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
let _json = JSON.parse(json);
if (_json.code == -3) { // 摄像头 未推流 重新播放推流
$that.viewCameras();
}
},
function(errInfo, error) {});
}
let param = {
params: {
page: 1,
row: 1,
communityId: vc.getCurrentCommunity().communityId,
machineId: _machine.machineId,
iotApiCode:'getPlayVideoUrlBmoImpl'
}
};
//发送get请求
vc.http.apiGet('/iot.getOpenApi',
param,
function (json, res) {
let _json = JSON.parse(json);
if (_json.code != 0) {
vc.toast(_json.msg);
return;
}
let image = document.getElementById(_item.id);
let jessibuca = new Jessibuca({
container: image,
videoBuffer: 0.2, // 缓存时长
isResize: false,
text: "",
loadingText: "",
useMSE: false,
debug: false,
isNotMute: false,
},);
_item.jessibuca = jessibuca;
jessibuca.play(_json.data);
}, function (errInfo, error) {
console.log('请求失败处理');
}
);
}
vc.emit('selectVideoMachine', 'openSelectVideo', _item);
},
_changeCount: function(_count) {
_changeCount: function (_count) {
$that.cameraControlVideoInfo.cameraCount = _count;
vc.jumpToPage('/video.html#/pages/property/videoControl?cameraCount=' + _count)
vc.jumpToPage('/#/video.html#/pages/property/videoControl?cameraCount=' + _count)
}
}
});

1
public/decoder.js Normal file

File diff suppressed because one or more lines are too long

BIN
public/decoder.wasm Normal file

Binary file not shown.

View File

@ -2,12 +2,12 @@
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<title>监控视频</title>
<script src="./jessibuca.js"></script>
</head>
<body>
<div class="container-shell">
<div id="container" style="width: 100%;height: 300px;"></div>
<div id="container" style="width: 100%;height: 600px;"></div>
</div>

View File

@ -0,0 +1,45 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>监控视频</title>
<script src="./jessibuca.js"></script>
</head>
<body>
<div class="container-shell">
<div id="container" style="width: 100%;height: 300px;"></div>
</div>
<script>
function _play() {
let image = document.getElementById("container");
let jessibuca = new Jessibuca({
container: image,
videoBuffer: 0.2, // 缓存时长
isResize: false,
text: "",
loadingText: "",
useMSE: false,
debug: false,
isNotMute: false,
operateBtns: {
fullscreen: true,
screenshot: true,
play: true,
audio: false,
recorder: false
},
});
const urlParams = new URLSearchParams(window.location.search);
const tt = urlParams.get('tt'); // "john"
jessibuca.play(
tt
);
}
_play();
</script>
</body>
</html>

637
public/js/jessibuca/jessibuca.d.ts vendored Normal file
View File

@ -0,0 +1,637 @@
declare namespace Jessibuca {
/** 超时信息 */
enum TIMEOUT {
/** 当play()的时候,如果没有数据返回 */
loadingTimeout = 'loadingTimeout',
/** 当播放过程中如果超过timeout之后没有数据渲染 */
delayTimeout = 'delayTimeout',
}
/** 错误信息 */
enum ERROR {
/** 播放错误url 为空的时候,调用 play 方法 */
playError = 'playError',
/** http 请求失败 */
fetchError = 'fetchError',
/** websocket 请求失败 */
websocketError = 'websocketError',
/** webcodecs 解码 h265 失败 */
webcodecsH265NotSupport = 'webcodecsH265NotSupport',
/** mediaSource 解码 h265 失败 */
mediaSourceH265NotSupport = 'mediaSourceH265NotSupport',
/** wasm 解码失败 */
wasmDecodeError = 'wasmDecodeError',
}
interface Config {
/**
*
* * string document.getElementById('id')
* */
container: HTMLElement | string;
/**
*
*/
videoBuffer?: number;
/**
* worker地址
* * decoder.js文件 decoder.js decoder.wasm文件必须是放在同一个目录下面 */
decoder?: string;
/**
* 使
*/
forceNoOffscreen?: boolean;
/**
* 'visibilityState''hidden'
*/
hiddenAutoPause?: boolean;
/**
* `false`
*/
hasAudio?: boolean;
/**
* 0()180270
*/
rotate?: boolean;
/**
* 1. `true`,canvas区域,, `setScaleMode(1)`
* 2. `false`canvas区域, `setScaleMode(0)`
*/
isResize?: boolean;
/**
* 1. `true`,canvas区域,,, `setScaleMode(2)`
*/
isFullResize?: boolean;
/**
* 1. `true`ws协议不检验是否以.flv为依据
*/
isFlv?: boolean;
/**
*
*/
debug?: boolean;
/**
* 1. ,
* 2. (loading)(heart),,timeout事件
*/
timeout?: number;
/**
* 1. ,
* 2. ,,timeout事件
*/
heartTimeout?: number;
/**
* 1. ,
* 2. ,,timeout事件
*/
loadingTimeout?: number;
/**
*
*/
supportDblclickFullscreen?: boolean;
/**
*
*/
showBandwidth?: boolean;
/**
*
*/
operateBtns?: {
/** 是否显示全屏按钮 */
fullscreen?: boolean;
/** 是否显示截图按钮 */
screenshot?: boolean;
/** 是否显示播放暂停按钮 */
play?: boolean;
/** 是否显示声音按钮 */
audio?: boolean;
/** 是否显示录制按 */
record?: boolean;
};
/**
* , canvas标签渲染视频并不会像video标签那样保持屏幕常亮
*/
keepScreenOn?: boolean;
/**
*
*/
isNotMute?: boolean;
/**
*
*/
loadingText?: string;
/**
*
*/
background?: string;
/**
* MediaSource硬解码
* * H.264Safari on iOS不支持
* * forceNoOffscreen false ()
*/
useMSE?: boolean;
/**
* Webcodecs硬解码
* * H.264 (chrome 94https或者localhost环境)
* * forceNoOffscreen false )
* */
useWCS?: boolean;
/**
*
* esc -> 退arrowUp -> arrowDown ->
*/
hotKey?: boolean;
/**
* 使MSE或者Webcodecs H265的时候wasm模式
* false Error true wasm模式播放
*/
autoWasm?: boolean;
/**
* heartTimeout ,
*/
heartTimeoutReplay?: boolean,
/**
* heartTimeoutReplay
*/
heartTimeoutReplayTimes?: number,
/**
* loadingTimeout loading之后自动再播放,
*/
loadingTimeoutReplay?: boolean,
/**
* heartTimeoutReplay
*/
loadingTimeoutReplayTimes?: number
/**
* wasm解码报错之后
*/
wasmDecodeErrorReplay?: boolean,
/**
* https://github.com/langhuihui/jessibuca/issues/152 解决方案
* WebGL图像预处理默认每次取4字节的数据540x960分辨率下的UV分量宽度是540/2=2704绿
*/
openWebglAlignment?: boolean
}
}
declare class Jessibuca {
constructor(config?: Jessibuca.Config);
/**
*
@example
// 开启
jessibuca.setDebug(true)
// 关闭
jessibuca.setDebug(false)
*/
setDebug(flag: boolean): void;
/**
*
@example
jessibuca.mute()
*/
mute(): void;
/**
*
@example
jessibuca.cancelMute()
*/
cancelMute(): void;
/**
*
*
* iPhonechrome等要求自动播放时使
*
* https://developers.google.com/web/updates/2017/09/autoplay-policy-changes
*/
audioResume(): void;
/**
*
* ,
* ,,timeout事件
@example
jessibuca.setTimeout(10)
jessibuca.on('timeout',function(){
//
});
*/
setTimeout(): void;
/**
* @param mode
* 0 canvas区域, `isResize` false
*
* 1 ,canvas区域,, `isResize` true
*
* 2 ,canvas区域,,, `isFullResize` true
@example
jessibuca.setScaleMode(0)
jessibuca.setScaleMode(1)
jessibuca.setScaleMode(2)
*/
setScaleMode(mode: number): void;
/**
*
*
* pause `play()`
@example
jessibuca.pause().then(()=>{
console.log('pause success')
jessibuca.play().then(()=>{
}).catch((e)=>{
})
}).catch((e)=>{
console.log('pause error',e);
})
*/
pause(): Promise<void>;
/**
* ,
@example
jessibuca.close();
*/
close(): void;
/**
*
@example
jessibuca.destroy()
*/
destroy(): void;
/**
*
@example
jessibuca.clearView()
*/
clearView(): void;
/**
*
@example
jessibuca.play('url').then(()=>{
console.log('play success')
}).catch((e)=>{
console.log('play error',e)
})
//
jessibuca.play()
*/
play(url?: string): Promise<void>;
/**
*
*/
resize(): void;
/**
*
*
* `videoBuffer`
*
@example
// 设置 200ms 缓冲
jessibuca.setBufferTime(0.2)
*/
setBufferTime(time: number): void;
/**
* 0() 180270
*
* > iOS没有全屏API *
@example
jessibuca.setRotate(0)
jessibuca.setRotate(90)
jessibuca.setRotate(270)
*/
setRotate(deg: number): void;
/**
*
* 0 1
*
* > mute cancelMute setVolume(0) mute方法mute setVolume(0)0
* @param volume 0;1
@example
jessibuca.setVolume(0.2)
jessibuca.setVolume(0)
jessibuca.setVolume(1)
*/
setVolume(volume: number): void;
/**
*
@example
var result = jessibuca.hasLoaded()
console.log(result) // true
*/
hasLoaded(): boolean;
/**
* , canvas标签渲染视频并不会像video标签那样保持屏幕常亮
* H5目前在chrome\edge 84, android chrome 84API, https页面
*
@example
jessibuca.setKeepScreenOn()
*/
setKeepScreenOn(): boolean;
/**
* ()
@example
jessibuca.setFullscreen(true)
//
jessibuca.setFullscreen(false)
*/
setFullscreen(flag: boolean): void;
/**
*
*
* @param filename , , `时间戳`
* @param format , png或jpeg或者webp , `png`
* @param quality , jpeg或者webp时0 ~ 1 , `0.92`
* @param type , download或者base64或者blob`download`
@example
jessibuca.screenshot("test","png",0.5)
const base64 = jessibuca.screenshot("test","png",0.5,'base64')
const fileBlob = jessibuca.screenshot("test",'blob')
*/
screenshot(filename?: string, format?: string, quality?: number, type?: string): void;
/**
*
* @param fileName
* @param fileType webmwebm mp4
@example
jessibuca.startRecord('xxx','webm')
*/
startRecord(fileName: string, fileType: string): void;
/**
*
@example
jessibuca.stopRecordAndSave()
*/
stopRecordAndSave(): void;
/**
*
@example
var result = jessibuca.isPlaying()
console.log(result) // true
*/
isPlaying(): boolean;
/**
*
@example
var result = jessibuca.isMute()
console.log(result) // true
*/
isMute(): boolean;
/**
*
@example
var result = jessibuca.isRecording()
console.log(result) // true
*/
isRecording(): boolean;
/**
* jessibuca
* @example
* jessibuca.on("load",function(){console.log('load')})
*/
on(event: 'load', callback: () => void): void;
/**
* ms
* @example
* jessibuca.on('timeUpdate',function (ts) {console.log('timeUpdate',ts);})
*/
on(event: 'timeUpdate', callback: () => void): void;
/**
* 2
* @example
* jessibuca.on("videoInfo",function(data){console.log('width:',data.width,'height:',data.width)})
*/
on(event: 'videoInfo', callback: (data: {
/** 视频宽 */
width: number;
/** 视频高 */
height: number;
}) => void): void;
/**
* 2
* @example
* jessibuca.on("audioInfo",function(data){console.log('numOfChannels:',data.numOfChannels,'sampleRate',data.sampleRate)})
*/
on(event: 'audioInfo', callback: (data: {
/** 声频通道 */
numOfChannels: number;
/** 采样率 */
sampleRate: number;
}) => void): void;
/**
*
* @example
* jessibuca.on("log",function(data){console.log('data:',data)})
*/
on(event: 'log', callback: () => void): void;
/**
*
* @example
* jessibuca.on("error",function(error){
if(error === Jessibuca.ERROR.fetchError){
//
}
else if(error === Jessibuca.ERROR.webcodecsH265NotSupport){
//
}
console.log('error:',error)
})
*/
on(event: 'error', callback: (err: Jessibuca.ERROR) => void): void;
/**
* KB 1,
* @example
* jessibuca.on("kBps",function(data){console.log('kBps:',data)})
*/
on(event: 'kBps', callback: (value: number) => void): void;
/**
*
* @example
* jessibuca.on("start",function(){console.log('start render')})
*/
on(event: 'start', callback: () => void): void;
/**
* ,
* @example
* jessibuca.on("timeout",function(error){console.log('timeout:',error)})
*/
on(event: 'timeout', callback: (error: Jessibuca.TIMEOUT) => void): void;
/**
* play()
* @example
* jessibuca.on("loadingTimeout",function(){console.log('timeout')})
*/
on(event: 'loadingTimeout', callback: () => void): void;
/**
* timeout之后没有数据渲染
* @example
* jessibuca.on("delayTimeout",function(){console.log('timeout')})
*/
on(event: 'delayTimeout', callback: () => void): void;
/**
*
* @example
* jessibuca.on("fullscreen",function(flag){console.log('is fullscreen',flag)})
*/
on(event: 'fullscreen', callback: () => void): void;
/**
*
* @example
* jessibuca.on("play",function(flag){console.log('play')})
*/
on(event: 'play', callback: () => void): void;
/**
*
* @example
* jessibuca.on("pause",function(flag){console.log('pause')})
*/
on(event: 'pause', callback: () => void): void;
/**
* boolean值
* @example
* jessibuca.on("mute",function(flag){console.log('is mute',flag)})
*/
on(event: 'mute', callback: () => void): void;
/**
* 1
* @example
* jessibuca.on("stats",function(s){console.log("stats is",s)})
*/
on(event: 'stats', callback: (stats: {
/** 当前缓冲区时长,单位毫秒 */
buf: number;
/** 当前视频帧率 */
fps: number;
/** 当前音频码率单位byte */
abps: number;
/** 当前视频码率单位byte */
vbps: number;
/** 当前视频帧pts单位毫秒 */
ts: number;
}) => void): void;
/**
* 1
* @param performance 0: 表示卡顿,1: 表示流畅,2: 表示非常流程
* @example
* jessibuca.on("performance",function(performance){console.log("performance is",performance)})
*/
on(event: 'performance', callback: (performance: 0 | 1 | 2) => void): void;
/**
*
* @example
* jessibuca.on("recordStart",function(){console.log("record start")})
*/
on(event: 'recordStart', callback: () => void): void;
/**
*
* @example
* jessibuca.on("recordEnd",function(){console.log("record end")})
*/
on(event: 'recordEnd', callback: () => void): void;
/**
* 1s一次
* @example
* jessibuca.on("recordingTimestamp",function(timestamp){console.log("recordingTimestamp is",timestamp)})
*/
on(event: 'recordingTimestamp', callback: (timestamp: number) => void): void;
/**
* play方法 -> -> -> ->
* @param event
* @param callback
*/
on(event: 'playToRenderTimes', callback: (times: {
playInitStart: number, // 1 初始化
playStart: number, // 2 初始化
streamStart: number, // 3 网络请求
streamResponse: number, // 4 网络请求
demuxStart: number, // 5 解封装
decodeStart: number, // 6 解码
videoStart: number, // 7 渲染
playTimestamp: number,// playStart- playInitStart
streamTimestamp: number,// streamStart - playStart
streamResponseTimestamp: number,// streamResponse - streamStart
demuxTimestamp: number, // demuxStart - streamResponse
decodeTimestamp: number, // decodeStart - demuxStart
videoTimestamp: number,// videoStart - decodeStart
allTimestamp: number // videoStart - playInitStart
}) => void): void
/**
*
*
@example
jessibuca.on("load",function(){console.log('load')})
*/
on(event: string, callback: Function): void;
}
export default Jessibuca;

File diff suppressed because one or more lines are too long

View File

@ -14,7 +14,7 @@
detailId: '',
conditions: {
detailId: '',
userName: '',
userNameLike: '',
tel: '',
communityId:''
}

View File

@ -71,7 +71,7 @@
</div>
</div>
<script src="/vcCore/vc-lang.js"></script>
<script src="/js/jessibuca/renderer.js"></script>
<script src="/js/jessibuca/jessibuca.js"></script>
<script src="/vcCore/vcFramework.js"></script>
<vc:create path="frame/commonBottom" location="body"></vc:create>
</body>