
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
custom-player
Advanced tools
npm install custom-player --save-dev
//or
<script src="custom-player"></script>
SZPlayer.createPlayer();
<div id="container"></div>
import FlvPlayer from 'custom-player';
//直播
const container = document.getElementById('container');
const player = FlvPlayer.createPlayer(container, {
mode: 'real',
options: {
stream: 'http://192.168.2.155:1945/34020000001320000145_771/playback.flv',
reconnectServer: '',
deviceId: '',
appId: ''
}
});
//回放
const player = FlvPlayer.createPlayer(container, {
mode: 'playback',
options: {
startServer: '',
stopServer: '',
beginTimeStamp: '',
endTimeStamp: '',
reconnectServer: '',
deviceId: '',
appId: ''
}
});
key | value |
---|---|
mode | 'real':直播模式;'playback':回放模式;必填 |
stream | 直播流地址,直播模式必填 |
reconnectServer | 断流重连服务 |
deviceId | 设备ID,回放模式和断流重连必填 |
appId | 断流重连必填 |
startServer | 起流服务,回放模式必填 |
stopServer | 停流服务,回放模式必填 |
beginTimeStamp | 回放流起始时间戳,精确到秒(s) |
endTimeStamp | 回放流终止时间戳,精确到秒(s) |
streamType | 回放流类型,默认是flv |
recordType | 录像类型 1 手动录像 2 报警录像 4 录像计划 0或不传 表示所有,选填 |
saveType | 1 device or 2 oss,选填 |
const player = FlvPlayer.createPlayer(dom, {
mode: 'real',
options: {
...
}
});
getCurrentTime:获取当前播放时间;
player.getCurrentTime();
screenshot:截图,返回base64图片数据;
player.screenshot();
replaceDevice:设备切换,参数 deviceId,appId 回放模式下有效;
player.replaceDevice(deviceId, appId);
replaceStream:视频流切换,参数 stream,deviceId, appId 直播模式下有效;
player.replaceStream(stream, deviceId, appId);
FAQs
webPlayer base of flvjs
The npm package custom-player receives a total of 1 weekly downloads. As such, custom-player popularity was classified as not popular.
We found that custom-player demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.