@vtx/player 1.2.13 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/history-player/index.js +8 -4
- package/lib/history-player/index.js.map +1 -1
- package/lib/icc/PlayerManager.js +17 -14
- package/lib/icc/PlayerManager.js.map +1 -1
- package/lib/live-control-v2/index.d.ts +3 -1
- package/lib/live-control-v2/index.js +3 -2
- package/lib/live-control-v2/index.js.map +1 -1
- package/lib/live-player/index.js +8 -3
- package/lib/live-player/index.js.map +1 -1
- package/lib/player/index.d.ts +1 -1
- package/lib/player/index.js +38 -17
- package/lib/player/index.js.map +1 -1
- package/lib/typings/webrtcplayer.d.ts +56 -0
- package/lib/utils/index.js +8 -9
- package/lib/utils/index.js.map +1 -1
- package/lib/webrtc/PlayerManager.d.ts +67 -0
- package/lib/webrtc/PlayerManager.js +163 -0
- package/lib/webrtc/PlayerManager.js.map +1 -0
- package/package.json +1 -1
- package/lib/live-player-image/index.d.ts +0 -36
- package/lib/live-player-image/index.js +0 -238
- package/lib/live-player-image/index.js.map +0 -1
- package/lib/live-player-image/style/css.js +0 -8
- package/lib/live-player-image/style/css.js.map +0 -1
- package/lib/live-player-image/style/index.css +0 -74
- package/lib/live-player-image/style/index.d.ts +0 -3
- package/lib/live-player-image/style/index.js +0 -8
- package/lib/live-player-image/style/index.js.map +0 -1
- package/lib/live-player-image/style/index.less +0 -70
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
|
|
8
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
9
|
+
|
|
10
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
11
|
+
|
|
12
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
13
|
+
|
|
14
|
+
var SrsRtcPlayerConstructor = SrsRtcPlayerAsync;
|
|
15
|
+
/**
|
|
16
|
+
* WSPlayer是核心组件
|
|
17
|
+
* API 封装了接口
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
var WebrtcPlayerManager = /*#__PURE__*/function () {
|
|
21
|
+
function WebrtcPlayerManager(opt) {
|
|
22
|
+
_classCallCheck(this, WebrtcPlayerManager);
|
|
23
|
+
|
|
24
|
+
// 播放器所在的容器ID
|
|
25
|
+
this.el = opt.el; // 实时预览播放器
|
|
26
|
+
|
|
27
|
+
this.realPlayer = null; // 录像回放播放器
|
|
28
|
+
|
|
29
|
+
this.recordPlayer = null;
|
|
30
|
+
this.player = null;
|
|
31
|
+
this.url = opt.url; // 实时预览还是录像回放播放器
|
|
32
|
+
|
|
33
|
+
this.type = opt.type; // 窗口的数量
|
|
34
|
+
|
|
35
|
+
this.playNum = 1; // 当前选中的窗口的索引
|
|
36
|
+
|
|
37
|
+
this.playIndex = 0; // 当前选中窗口正在播放视频的通道
|
|
38
|
+
|
|
39
|
+
this.currentChannelId = ''; // 索引对应窗口,保存当日录像信息
|
|
40
|
+
|
|
41
|
+
this.recordList = [];
|
|
42
|
+
this.init(opt);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
_createClass(WebrtcPlayerManager, [{
|
|
46
|
+
key: "init",
|
|
47
|
+
value: function init(opt) {
|
|
48
|
+
this.initPlayer(opt);
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* 初始化实时预览播放器
|
|
52
|
+
*/
|
|
53
|
+
|
|
54
|
+
}, {
|
|
55
|
+
key: "initPlayer",
|
|
56
|
+
value: function initPlayer(opt) {
|
|
57
|
+
this.playNum = opt.num;
|
|
58
|
+
this.realPlayer = new SrsRtcPlayerConstructor();
|
|
59
|
+
|
|
60
|
+
if (this.type) {
|
|
61
|
+
$("#".concat(this.el)).prop('srcObject', this.realPlayer.stream);
|
|
62
|
+
} else {
|
|
63
|
+
$("#".concat(this.el)).prop('src', this.realPlayer.stream);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
this.realPlayer.play(this.url)["catch"](function (reason) {
|
|
67
|
+
this.realPlayer.close();
|
|
68
|
+
console.error(reason);
|
|
69
|
+
});
|
|
70
|
+
this.player = this.realPlayer;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* 录像暂停
|
|
74
|
+
* 只有正在播放的录像调用才有效
|
|
75
|
+
*/
|
|
76
|
+
|
|
77
|
+
}, {
|
|
78
|
+
key: "pause",
|
|
79
|
+
value: function pause() {
|
|
80
|
+
this.recordPlayer && this.recordPlayer.pause();
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* 录像暂停后播放
|
|
84
|
+
* 只有暂停后的录像调用才有效
|
|
85
|
+
*/
|
|
86
|
+
|
|
87
|
+
}, {
|
|
88
|
+
key: "play",
|
|
89
|
+
value: function play() {
|
|
90
|
+
this.realPlayer && this.realPlayer.play(this.url);
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* 倍速播放
|
|
94
|
+
* @param {number} speed 速率 0.125 0.25 0.5 1 2 4 8 共7种速率
|
|
95
|
+
*/
|
|
96
|
+
|
|
97
|
+
}, {
|
|
98
|
+
key: "playSpeed",
|
|
99
|
+
value: function playSpeed(speed) {
|
|
100
|
+
this.recordPlayer && this.recordPlayer.playSpeed(speed);
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* 关闭播放器
|
|
104
|
+
* @param {number} index 可选,关闭指定索引的窗口的播放器,不传则表示关闭所有播放器
|
|
105
|
+
*/
|
|
106
|
+
|
|
107
|
+
}, {
|
|
108
|
+
key: "close",
|
|
109
|
+
value: function close(index) {
|
|
110
|
+
this.player && this.player.close(index);
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* 设置全屏
|
|
114
|
+
*/
|
|
115
|
+
|
|
116
|
+
}, {
|
|
117
|
+
key: "setFullScreen",
|
|
118
|
+
value: function setFullScreen() {// this.player.setFullScreen();
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* 设置窗口自适应还是拉伸
|
|
122
|
+
* @param {string} playerAdapter selfAdaption 自适应 | stretching 拉伸
|
|
123
|
+
*/
|
|
124
|
+
|
|
125
|
+
}, {
|
|
126
|
+
key: "setPlayerAdapter",
|
|
127
|
+
value: function setPlayerAdapter(playerAdapter) {// this.player.setPlayerAdapter(playerAdapter);
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* 控制视频播放器显示的路数: 1 4 9 16 25,不会超过最大显示路数
|
|
131
|
+
* @param {number} number
|
|
132
|
+
*/
|
|
133
|
+
|
|
134
|
+
}, {
|
|
135
|
+
key: "setPlayerNum",
|
|
136
|
+
value: function setPlayerNum(number) {// this.player.setPlayerNum(number);
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* 设置选中的播放器的索引
|
|
140
|
+
* @param {number} index
|
|
141
|
+
*/
|
|
142
|
+
|
|
143
|
+
}, {
|
|
144
|
+
key: "setSelectIndex",
|
|
145
|
+
value: function setSelectIndex(index) {// this.player.setSelectIndex(index);
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* 录像跳转播放
|
|
149
|
+
* @param {string} time HH:mm:ss格式
|
|
150
|
+
*/
|
|
151
|
+
|
|
152
|
+
}, {
|
|
153
|
+
key: "jumpPlayByTime",
|
|
154
|
+
value: function jumpPlayByTime(time) {// this.player.jumpPlayByTime(time);
|
|
155
|
+
}
|
|
156
|
+
}]);
|
|
157
|
+
|
|
158
|
+
return WebrtcPlayerManager;
|
|
159
|
+
}();
|
|
160
|
+
|
|
161
|
+
var _default = WebrtcPlayerManager;
|
|
162
|
+
exports["default"] = _default;
|
|
163
|
+
//# sourceMappingURL=PlayerManager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PlayerManager.js","names":["SrsRtcPlayerConstructor","SrsRtcPlayerAsync","WebrtcPlayerManager","opt","el","realPlayer","recordPlayer","player","url","type","playNum","playIndex","currentChannelId","recordList","init","initPlayer","num","$","prop","stream","play","reason","close","console","error","pause","speed","playSpeed","index","playerAdapter","number","time"],"sources":["webrtc/PlayerManager.js"],"sourcesContent":["let SrsRtcPlayerConstructor = SrsRtcPlayerAsync;\n/**\n * WSPlayer是核心组件\n * API 封装了接口\n */\nclass WebrtcPlayerManager {\n constructor(opt) {\n // 播放器所在的容器ID\n this.el = opt.el;\n // 实时预览播放器\n this.realPlayer = null;\n // 录像回放播放器\n this.recordPlayer = null;\n this.player = null;\n this.url = opt.url;\n // 实时预览还是录像回放播放器\n this.type = opt.type;\n // 窗口的数量\n this.playNum = 1;\n // 当前选中的窗口的索引\n this.playIndex = 0;\n // 当前选中窗口正在播放视频的通道\n this.currentChannelId = '';\n // 索引对应窗口,保存当日录像信息\n this.recordList = [];\n this.init(opt);\n }\n init(opt) {\n this.initPlayer(opt);\n }\n /**\n * 初始化实时预览播放器\n */\n initPlayer(opt) {\n this.playNum = opt.num;\n this.realPlayer = new SrsRtcPlayerConstructor();\n if (this.type) {\n $(`#${this.el}`).prop('srcObject', this.realPlayer.stream);\n }\n else {\n $(`#${this.el}`).prop('src', this.realPlayer.stream);\n }\n this.realPlayer.play(this.url).catch(function (reason) {\n this.realPlayer.close();\n console.error(reason);\n });\n this.player = this.realPlayer;\n }\n /**\n * 录像暂停\n * 只有正在播放的录像调用才有效\n */\n pause() {\n this.recordPlayer && this.recordPlayer.pause();\n }\n /**\n * 录像暂停后播放\n * 只有暂停后的录像调用才有效\n */\n play() {\n this.realPlayer && this.realPlayer.play(this.url);\n }\n /**\n * 倍速播放\n * @param {number} speed 速率 0.125 0.25 0.5 1 2 4 8 共7种速率\n */\n playSpeed(speed) {\n this.recordPlayer && this.recordPlayer.playSpeed(speed);\n }\n /**\n * 关闭播放器\n * @param {number} index 可选,关闭指定索引的窗口的播放器,不传则表示关闭所有播放器\n */\n close(index) {\n this.player && this.player.close(index);\n }\n /**\n * 设置全屏\n */\n setFullScreen() {\n // this.player.setFullScreen();\n }\n /**\n * 设置窗口自适应还是拉伸\n * @param {string} playerAdapter selfAdaption 自适应 | stretching 拉伸\n */\n setPlayerAdapter(playerAdapter) {\n // this.player.setPlayerAdapter(playerAdapter);\n }\n /**\n * 控制视频播放器显示的路数: 1 4 9 16 25,不会超过最大显示路数\n * @param {number} number\n */\n setPlayerNum(number) {\n // this.player.setPlayerNum(number);\n }\n /**\n * 设置选中的播放器的索引\n * @param {number} index\n */\n setSelectIndex(index) {\n // this.player.setSelectIndex(index);\n }\n /**\n * 录像跳转播放\n * @param {string} time HH:mm:ss格式\n */\n jumpPlayByTime(time) {\n // this.player.jumpPlayByTime(time);\n }\n}\nexport default WebrtcPlayerManager;\n"],"mappings":";;;;;;;;;;;;;AAAA,IAAIA,uBAAuB,GAAGC,iBAA9B;AACA;AACA;AACA;AACA;;IACMC,mB;EACF,6BAAYC,GAAZ,EAAiB;IAAA;;IACb;IACA,KAAKC,EAAL,GAAUD,GAAG,CAACC,EAAd,CAFa,CAGb;;IACA,KAAKC,UAAL,GAAkB,IAAlB,CAJa,CAKb;;IACA,KAAKC,YAAL,GAAoB,IAApB;IACA,KAAKC,MAAL,GAAc,IAAd;IACA,KAAKC,GAAL,GAAWL,GAAG,CAACK,GAAf,CARa,CASb;;IACA,KAAKC,IAAL,GAAYN,GAAG,CAACM,IAAhB,CAVa,CAWb;;IACA,KAAKC,OAAL,GAAe,CAAf,CAZa,CAab;;IACA,KAAKC,SAAL,GAAiB,CAAjB,CAda,CAeb;;IACA,KAAKC,gBAAL,GAAwB,EAAxB,CAhBa,CA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KAAlB,CAAf;IACH;IACD;AACJ;AACA;;;;WACI,yBAAgB,CACZ;IACH;IACD;AACJ;AACA;AACA;;;;WACI,0BAAiBC,aAAjB,EAAgC,CAC5B;IACH;IACD;AACJ;AACA;AACA;;;;WACI,sBAAaC,MAAb,EAAqB,CACjB;IACH;IACD;AACJ;AACA;AACA;;;;WACI,wBAAeF,KAAf,EAAsB,CAClB;IACH;IACD;AACJ;AACA;AACA;;;;WACI,wBAAeG,IAAf,EAAqB,CACjB;IACH;;;;;;eAEU7B,mB"}
|
package/package.json
CHANGED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { CloudControlPanelProps } from '../controls';
|
|
3
|
-
import { VideoType } from '../player';
|
|
4
|
-
interface VtxPlayerProps {
|
|
5
|
-
/** 视频流地址 */
|
|
6
|
-
url: string;
|
|
7
|
-
/** 是否使用代理播放 */
|
|
8
|
-
enableAgent?: boolean;
|
|
9
|
-
/** 宽度 */
|
|
10
|
-
width?: number;
|
|
11
|
-
/** 高度 */
|
|
12
|
-
height?: number;
|
|
13
|
-
/** 视频流格式,如果为空则根据url自行判断 */
|
|
14
|
-
type?: VideoType;
|
|
15
|
-
/** 截图文件名 */
|
|
16
|
-
captureName?: string;
|
|
17
|
-
/** 通道号 */
|
|
18
|
-
channelNum?: string;
|
|
19
|
-
/** 设备id */
|
|
20
|
-
deviceId?: string;
|
|
21
|
-
/** 云台控制 */
|
|
22
|
-
cloudParams?: CloudControlPanelProps;
|
|
23
|
-
/** 是否展示信息 */
|
|
24
|
-
showInfo?: boolean | 'leftTop' | 'leftBottom' | 'rightTop' | 'rightBottom';
|
|
25
|
-
/** 信息 */
|
|
26
|
-
info?: Array<Array<string>>;
|
|
27
|
-
/** 截图回调 */
|
|
28
|
-
screenshot?: (dataURL: string) => void;
|
|
29
|
-
/** 重置视频大小 */
|
|
30
|
-
resize?: () => void;
|
|
31
|
-
/** 加载结束回调 */
|
|
32
|
-
loaded?: () => void;
|
|
33
|
-
}
|
|
34
|
-
export declare const LivePlayerImage: (props: VtxPlayerProps, selfRef: any) => JSX.Element;
|
|
35
|
-
declare const _default: React.ForwardRefExoticComponent<VtxPlayerProps & React.RefAttributes<unknown>>;
|
|
36
|
-
export default _default;
|
|
@@ -1,238 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports["default"] = exports.LivePlayerImage = void 0;
|
|
7
|
-
|
|
8
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
9
|
-
|
|
10
|
-
var _react = require("react");
|
|
11
|
-
|
|
12
|
-
var _controls = require("../controls");
|
|
13
|
-
|
|
14
|
-
var _icons = require("../icons");
|
|
15
|
-
|
|
16
|
-
var _player = _interopRequireDefault(require("../player"));
|
|
17
|
-
|
|
18
|
-
var _utils = require("../utils");
|
|
19
|
-
|
|
20
|
-
var _ahooks = require("ahooks");
|
|
21
|
-
|
|
22
|
-
var _space = _interopRequireDefault(require("antd/lib/space"));
|
|
23
|
-
|
|
24
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
25
|
-
|
|
26
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
27
|
-
|
|
28
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
29
|
-
|
|
30
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
31
|
-
|
|
32
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
33
|
-
|
|
34
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
35
|
-
|
|
36
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
37
|
-
|
|
38
|
-
var LivePlayerImage = function LivePlayerImage(props, selfRef) {
|
|
39
|
-
var url = props.url,
|
|
40
|
-
enableAgent = props.enableAgent,
|
|
41
|
-
_props$width = props.width,
|
|
42
|
-
width = _props$width === void 0 ? '100%' : _props$width,
|
|
43
|
-
_props$height = props.height,
|
|
44
|
-
height = _props$height === void 0 ? '100%' : _props$height,
|
|
45
|
-
captureName = props.captureName,
|
|
46
|
-
type = props.type,
|
|
47
|
-
channelNum = props.channelNum,
|
|
48
|
-
deviceId = props.deviceId,
|
|
49
|
-
cloudParams = props.cloudParams,
|
|
50
|
-
_props$showInfo = props.showInfo,
|
|
51
|
-
showInfo = _props$showInfo === void 0 ? false : _props$showInfo,
|
|
52
|
-
_props$info = props.info,
|
|
53
|
-
info = _props$info === void 0 ? [] : _props$info,
|
|
54
|
-
screenshot = props.screenshot,
|
|
55
|
-
loaded = props.loaded;
|
|
56
|
-
var ref = (0, _react.useRef)(null);
|
|
57
|
-
var wrapRef = (0, _react.useRef)(null);
|
|
58
|
-
var controlsRef = (0, _react.useRef)(null);
|
|
59
|
-
var playerRef = (0, _react.useRef)();
|
|
60
|
-
|
|
61
|
-
var _useFullscreen = (0, _ahooks.useFullscreen)(wrapRef),
|
|
62
|
-
_useFullscreen2 = _slicedToArray(_useFullscreen, 2),
|
|
63
|
-
isFullscreen = _useFullscreen2[0],
|
|
64
|
-
toggleFullscreen = _useFullscreen2[1].toggleFullscreen;
|
|
65
|
-
|
|
66
|
-
var _useSetState = (0, _ahooks.useSetState)({
|
|
67
|
-
play: false,
|
|
68
|
-
error: false,
|
|
69
|
-
loading: false,
|
|
70
|
-
id: 'vtx_hk_player_' + (0, _utils.guidGenerator)(),
|
|
71
|
-
volume: 0,
|
|
72
|
-
showCloudPanel: false
|
|
73
|
-
}),
|
|
74
|
-
_useSetState2 = _slicedToArray(_useSetState, 2),
|
|
75
|
-
state = _useSetState2[0],
|
|
76
|
-
setState = _useSetState2[1];
|
|
77
|
-
|
|
78
|
-
(0, _react.useImperativeHandle)(selfRef, function () {
|
|
79
|
-
return {
|
|
80
|
-
resize: function resize() {
|
|
81
|
-
var player = playerRef.current;
|
|
82
|
-
player && url && player.resize();
|
|
83
|
-
}
|
|
84
|
-
};
|
|
85
|
-
});
|
|
86
|
-
(0, _react.useEffect)(function () {
|
|
87
|
-
var container = ref.current;
|
|
88
|
-
|
|
89
|
-
if (!url || !container) {
|
|
90
|
-
playerRef.current && playerRef.current.destroy();
|
|
91
|
-
return;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
var player = new _player["default"]({
|
|
95
|
-
url: url,
|
|
96
|
-
channelNum: channelNum,
|
|
97
|
-
enableAgent: enableAgent,
|
|
98
|
-
container: container,
|
|
99
|
-
type: type
|
|
100
|
-
});
|
|
101
|
-
playerRef.current = player;
|
|
102
|
-
setState({
|
|
103
|
-
loading: true,
|
|
104
|
-
error: false
|
|
105
|
-
});
|
|
106
|
-
player.play().then(function () {
|
|
107
|
-
return setState({
|
|
108
|
-
play: true,
|
|
109
|
-
error: false
|
|
110
|
-
});
|
|
111
|
-
})["catch"](function () {
|
|
112
|
-
return setState({
|
|
113
|
-
error: true
|
|
114
|
-
});
|
|
115
|
-
})["finally"](function () {
|
|
116
|
-
setState({
|
|
117
|
-
loading: false
|
|
118
|
-
}), loaded && loaded();
|
|
119
|
-
});
|
|
120
|
-
return function () {
|
|
121
|
-
player.destroy();
|
|
122
|
-
setState({
|
|
123
|
-
error: false,
|
|
124
|
-
loading: false,
|
|
125
|
-
play: false
|
|
126
|
-
});
|
|
127
|
-
};
|
|
128
|
-
}, [url]);
|
|
129
|
-
(0, _react.useEffect)(function () {
|
|
130
|
-
var canvas = document.getElementById('canvas');
|
|
131
|
-
var ctx = canvas.getContext('2d');
|
|
132
|
-
var i = 0;
|
|
133
|
-
var timer = setInterval(function () {
|
|
134
|
-
ctx.beginPath();
|
|
135
|
-
var x = Math.random() * 300;
|
|
136
|
-
var x2 = Math.random() * 150;
|
|
137
|
-
var y = Math.random() * 300;
|
|
138
|
-
var y2 = Math.random() * 150;
|
|
139
|
-
ctx.strokeStyle = 'red';
|
|
140
|
-
ctx.lineWidth = 3;
|
|
141
|
-
ctx.rect(x, y, x2 > 20 ? x2 : 20, y2 > 20 ? y2 : 20);
|
|
142
|
-
i++;
|
|
143
|
-
ctx.stroke(); // ctx.closePath();
|
|
144
|
-
|
|
145
|
-
if (i > 5) {
|
|
146
|
-
timer && clearTimeout(timer);
|
|
147
|
-
}
|
|
148
|
-
}, 2000);
|
|
149
|
-
return function () {
|
|
150
|
-
timer && clearTimeout(timer);
|
|
151
|
-
};
|
|
152
|
-
}, []);
|
|
153
|
-
|
|
154
|
-
var handleCapture = function handleCapture(e) {
|
|
155
|
-
var player = playerRef.current;
|
|
156
|
-
player && player.capture(captureName, screenshot);
|
|
157
|
-
e.stopPropagation();
|
|
158
|
-
};
|
|
159
|
-
|
|
160
|
-
var handleFullScreen = function handleFullScreen(e) {
|
|
161
|
-
toggleFullscreen();
|
|
162
|
-
var player = playerRef.current;
|
|
163
|
-
player && player.resize();
|
|
164
|
-
e.stopPropagation();
|
|
165
|
-
};
|
|
166
|
-
|
|
167
|
-
return (0, _jsxRuntime.jsxs)("div", Object.assign({
|
|
168
|
-
className: "vtx-live-player",
|
|
169
|
-
ref: wrapRef,
|
|
170
|
-
style: {
|
|
171
|
-
width: width,
|
|
172
|
-
height: height,
|
|
173
|
-
position: 'relative'
|
|
174
|
-
}
|
|
175
|
-
}, {
|
|
176
|
-
children: [(0, _jsxRuntime.jsx)("div", {
|
|
177
|
-
ref: ref,
|
|
178
|
-
style: {
|
|
179
|
-
height: '100%',
|
|
180
|
-
width: '100%'
|
|
181
|
-
},
|
|
182
|
-
id: state.id
|
|
183
|
-
}), (0, _jsxRuntime.jsx)("canvas", {
|
|
184
|
-
id: "canvas",
|
|
185
|
-
width: width,
|
|
186
|
-
height: height,
|
|
187
|
-
style: {
|
|
188
|
-
position: 'absolute',
|
|
189
|
-
top: 0,
|
|
190
|
-
left: 0,
|
|
191
|
-
right: 0,
|
|
192
|
-
bottom: 0
|
|
193
|
-
}
|
|
194
|
-
}), state.error && (0, _jsxRuntime.jsx)(_controls.ErrorState, {}), state.loading && (0, _jsxRuntime.jsx)(_controls.LoadingState, {}), state.showCloudPanel && cloudParams && (0, _jsxRuntime.jsx)(_controls.CloudControlPanel, Object.assign({}, cloudParams)), (0, _jsxRuntime.jsx)(_controls.InfoPanel, {
|
|
195
|
-
showInfo: showInfo,
|
|
196
|
-
info: info
|
|
197
|
-
}), (0, _jsxRuntime.jsx)("div", Object.assign({
|
|
198
|
-
className: "controls",
|
|
199
|
-
ref: controlsRef
|
|
200
|
-
}, {
|
|
201
|
-
children: (0, _jsxRuntime.jsxs)(_space["default"], Object.assign({
|
|
202
|
-
className: "right",
|
|
203
|
-
size: 12,
|
|
204
|
-
align: "center"
|
|
205
|
-
}, {
|
|
206
|
-
children: [(0, _jsxRuntime.jsx)(_controls.VolumeControl, {
|
|
207
|
-
player: playerRef.current,
|
|
208
|
-
container: controlsRef.current
|
|
209
|
-
}), !!screenshot && (0, _jsxRuntime.jsx)(_icons.CaptureIcon, {
|
|
210
|
-
onClick: handleCapture
|
|
211
|
-
}), channelNum && deviceId && (0, _jsxRuntime.jsx)(_controls.TalkControl, {
|
|
212
|
-
player: playerRef.current,
|
|
213
|
-
channelNum: channelNum,
|
|
214
|
-
deviceId: deviceId
|
|
215
|
-
}), (cloudParams === null || cloudParams === void 0 ? void 0 : cloudParams.type) !== 'none' && (0, _jsxRuntime.jsx)(_icons.CloudControlIcon, {
|
|
216
|
-
active: state.showCloudPanel,
|
|
217
|
-
onClick: function onClick() {
|
|
218
|
-
return setState({
|
|
219
|
-
showCloudPanel: !state.showCloudPanel
|
|
220
|
-
});
|
|
221
|
-
}
|
|
222
|
-
}), isFullscreen ? (0, _jsxRuntime.jsx)(_icons.ExitFullScreenIcon, {
|
|
223
|
-
onClick: handleFullScreen
|
|
224
|
-
}) : (0, _jsxRuntime.jsx)(_icons.FullScreenIcon, {
|
|
225
|
-
onClick: handleFullScreen
|
|
226
|
-
})]
|
|
227
|
-
}))
|
|
228
|
-
}))]
|
|
229
|
-
}));
|
|
230
|
-
}; // LivePlayerImage.displayName = 'live-player';
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
exports.LivePlayerImage = LivePlayerImage;
|
|
234
|
-
|
|
235
|
-
var _default = /*#__PURE__*/(0, _react.forwardRef)(LivePlayerImage);
|
|
236
|
-
|
|
237
|
-
exports["default"] = _default;
|
|
238
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["LivePlayerImage","props","selfRef","url","enableAgent","width","height","captureName","type","channelNum","deviceId","cloudParams","showInfo","info","screenshot","loaded","ref","useRef","wrapRef","controlsRef","playerRef","useFullscreen","isFullscreen","toggleFullscreen","useSetState","play","error","loading","id","guidGenerator","volume","showCloudPanel","state","setState","useImperativeHandle","resize","player","current","useEffect","container","destroy","Player","then","canvas","document","getElementById","ctx","getContext","i","timer","setInterval","beginPath","x","Math","random","x2","y","y2","strokeStyle","lineWidth","rect","stroke","clearTimeout","handleCapture","e","capture","stopPropagation","handleFullScreen","_jsxs","Object","assign","className","style","position","children","_jsx","top","left","right","bottom","ErrorState","LoadingState","CloudControlPanel","InfoPanel","Space","size","align","VolumeControl","CaptureIcon","onClick","TalkControl","CloudControlIcon","active","ExitFullScreenIcon","FullScreenIcon","forwardRef"],"sources":["live-player-image/index.js"],"sourcesContent":["import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { forwardRef, useEffect, useImperativeHandle, useRef } from 'react';\nimport { CloudControlPanel, ErrorState, InfoPanel, LoadingState, TalkControl, VolumeControl, } from '../controls';\nimport { CaptureIcon, CloudControlIcon, ExitFullScreenIcon, FullScreenIcon } from '../icons';\nimport Player from '../player';\nimport { guidGenerator } from '../utils';\nimport { useFullscreen, useSetState } from 'ahooks';\n// import { Space } from 'antd';\nimport Space from 'antd/lib/space';\nexport const LivePlayerImage = (props, selfRef) => {\n const { url, enableAgent, width = '100%', height = '100%', captureName, type, channelNum, deviceId, cloudParams, showInfo = false, info = [], screenshot, loaded, } = props;\n const ref = useRef(null);\n const wrapRef = useRef(null);\n const controlsRef = useRef(null);\n const playerRef = useRef();\n const [isFullscreen, { toggleFullscreen }] = useFullscreen(wrapRef);\n const [state, setState] = useSetState({\n play: false,\n error: false,\n loading: false,\n id: 'vtx_hk_player_' + guidGenerator(),\n volume: 0,\n showCloudPanel: false,\n });\n useImperativeHandle(selfRef, () => {\n return {\n resize: () => {\n const player = playerRef.current;\n player && url && player.resize();\n },\n };\n });\n useEffect(() => {\n const container = ref.current;\n if (!url || !container) {\n playerRef.current && playerRef.current.destroy();\n return;\n }\n const player = new Player({ url, channelNum, enableAgent, container, type });\n playerRef.current = player;\n setState({ loading: true, error: false });\n player\n .play()\n .then(() => setState({ play: true, error: false }))\n .catch(() => setState({ error: true }))\n .finally(() => {\n setState({ loading: false }), loaded && loaded();\n });\n return () => {\n player.destroy();\n setState({ error: false, loading: false, play: false });\n };\n }, [url]);\n useEffect(() => {\n const canvas = document.getElementById('canvas');\n const ctx = canvas.getContext('2d');\n let i = 0;\n const timer = setInterval(() => {\n ctx.beginPath();\n const x = Math.random() * 300;\n const x2 = Math.random() * 150;\n const y = Math.random() * 300;\n const y2 = Math.random() * 150;\n ctx.strokeStyle = 'red';\n ctx.lineWidth = 3;\n ctx.rect(x, y, x2 > 20 ? x2 : 20, y2 > 20 ? y2 : 20);\n i++;\n ctx.stroke();\n // ctx.closePath();\n if (i > 5) {\n timer && clearTimeout(timer);\n }\n }, 2000);\n return () => {\n timer && clearTimeout(timer);\n };\n }, []);\n const handleCapture = (e) => {\n const player = playerRef.current;\n player && player.capture(captureName, screenshot);\n e.stopPropagation();\n };\n const handleFullScreen = (e) => {\n toggleFullscreen();\n const player = playerRef.current;\n player && player.resize();\n e.stopPropagation();\n };\n return (_jsxs(\"div\", Object.assign({ className: \"vtx-live-player\", ref: wrapRef, style: { width, height, position: 'relative' } }, { children: [_jsx(\"div\", { ref: ref, style: { height: '100%', width: '100%' }, id: state.id }), _jsx(\"canvas\", { id: \"canvas\", width: width, height: height, style: {\n position: 'absolute',\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n } }), state.error && _jsx(ErrorState, {}), state.loading && _jsx(LoadingState, {}), state.showCloudPanel && cloudParams && _jsx(CloudControlPanel, Object.assign({}, cloudParams)), _jsx(InfoPanel, { showInfo: showInfo, info: info }), _jsx(\"div\", Object.assign({ className: \"controls\", ref: controlsRef }, { children: _jsxs(Space, Object.assign({ className: \"right\", size: 12, align: \"center\" }, { children: [_jsx(VolumeControl, { player: playerRef.current, container: controlsRef.current }), !!screenshot && _jsx(CaptureIcon, { onClick: handleCapture }), channelNum && deviceId && (_jsx(TalkControl, { player: playerRef.current, channelNum: channelNum, deviceId: deviceId })), (cloudParams === null || cloudParams === void 0 ? void 0 : cloudParams.type) !== 'none' && (_jsx(CloudControlIcon, { active: state.showCloudPanel, onClick: () => setState({ showCloudPanel: !state.showCloudPanel }) })), isFullscreen ? (_jsx(ExitFullScreenIcon, { onClick: handleFullScreen })) : (_jsx(FullScreenIcon, { onClick: handleFullScreen }))] })) }))] })));\n};\n// LivePlayerImage.displayName = 'live-player';\nexport default forwardRef(LivePlayerImage);\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;;;;;;;;;;;;;;;AACO,IAAMA,eAAe,GAAG,SAAlBA,eAAkB,CAACC,KAAD,EAAQC,OAAR,EAAoB;EAC/C,IAAQC,GAAR,GAAsKF,KAAtK,CAAQE,GAAR;EAAA,IAAaC,WAAb,GAAsKH,KAAtK,CAAaG,WAAb;EAAA,mBAAsKH,KAAtK,CAA0BI,KAA1B;EAAA,IAA0BA,KAA1B,6BAAkC,MAAlC;EAAA,oBAAsKJ,KAAtK,CAA0CK,MAA1C;EAAA,IAA0CA,MAA1C,8BAAmD,MAAnD;EAAA,IAA2DC,WAA3D,GAAsKN,KAAtK,CAA2DM,WAA3D;EAAA,IAAwEC,IAAxE,GAAsKP,KAAtK,CAAwEO,IAAxE;EAAA,IAA8EC,UAA9E,GAAsKR,KAAtK,CAA8EQ,UAA9E;EAAA,IAA0FC,QAA1F,GAAsKT,KAAtK,CAA0FS,QAA1F;EAAA,IAAoGC,WAApG,GAAsKV,KAAtK,CAAoGU,WAApG;EAAA,sBAAsKV,KAAtK,CAAiHW,QAAjH;EAAA,IAAiHA,QAAjH,gCAA4H,KAA5H;EAAA,kBAAsKX,KAAtK,CAAmIY,IAAnI;EAAA,IAAmIA,IAAnI,4BAA0I,EAA1I;EAAA,IAA8IC,UAA9I,GAAsKb,KAAtK,CAA8Ia,UAA9I;EAAA,IAA0JC,MAA1J,GAAsKd,KAAtK,CAA0Jc,MAA1J;EACA,IAAMC,GAAG,GAAG,IAAAC,aAAA,EAAO,IAAP,CAAZ;EACA,IAAMC,OAAO,GAAG,IAAAD,aAAA,EAAO,IAAP,CAAhB;EACA,IAAME,WAAW,GAAG,IAAAF,aAAA,EAAO,IAAP,CAApB;EACA,IA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AL,EAAkB;UAAEC,OAAO,EAAE1B;QAAX,CAAlB,CAArG,EAAoJtD,UAAU,IAAIC,QAAd,IAA2B,IAAAiE,eAAA,EAAKe,qBAAL,EAAkB;UAAEtD,MAAM,EAAEhB,SAAS,CAACiB,OAApB;UAA6B5B,UAAU,EAAEA,UAAzC;UAAqDC,QAAQ,EAAEA;QAA/D,CAAlB,CAA/K,EAA8Q,CAACC,WAAW,KAAK,IAAhB,IAAwBA,WAAW,KAAK,KAAK,CAA7C,GAAiD,KAAK,CAAtD,GAA0DA,WAAW,CAACH,IAAvE,MAAiF,MAAjF,IAA4F,IAAAmE,eAAA,EAAKgB,uBAAL,EAAuB;UAAEC,MAAM,EAAE5D,KAAK,CAACD,cAAhB;UAAgC0D,OAAO,EAAE;YAAA,OAAMxD,QAAQ,CAAC;cAAEF,cAAc,EAAE,CAACC,KAAK,CAACD;YAAzB,CAAD,CAAd;UAAA;QAAzC,CAAvB,CAA1W,EAAyeT,YAAY,GAAI,IAAAqD,eAAA,EAAKkB,yBAAL,EAAyB;UAAEJ,OAAO,EAAEtB;QAAX,CAAzB,CAAJ,GAAgE,IAAAQ,eAAA,EAAKmB,qBAAL,EAAqB;UAAEL,OAAO,EAAEtB;QAAX,CAArB,CAArjB;MAAZ,CAAjE,CAAb;IAAZ,CAA3D,CAAZ,CANtG;EAAZ,CAA9G,CAAb,CAAR;AAOH,CAtFM,C,CAuFP;;;;;4BACe,IAAA4B,iBAAA,EAAW/F,eAAX,C"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"css.js","names":[],"sources":["live-player-image/style/index.js"],"sourcesContent":["import \"antd/lib/space/style\";\nimport '../../controls/style';\nimport './index.less';\n"],"mappings":";;AAAA;;AACA;;AACA"}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
.vtx-live-player {
|
|
2
|
-
position: relative;
|
|
3
|
-
background-color: #2b3d51;
|
|
4
|
-
border: 1px solid transparent;
|
|
5
|
-
}
|
|
6
|
-
.vtx-live-player .controls {
|
|
7
|
-
position: absolute;
|
|
8
|
-
bottom: 0;
|
|
9
|
-
display: -webkit-box;
|
|
10
|
-
display: -ms-flexbox;
|
|
11
|
-
display: flex;
|
|
12
|
-
-webkit-box-align: center;
|
|
13
|
-
-ms-flex-align: center;
|
|
14
|
-
align-items: center;
|
|
15
|
-
width: 100%;
|
|
16
|
-
height: 30px;
|
|
17
|
-
padding: 0 12px;
|
|
18
|
-
background-color: #131d27;
|
|
19
|
-
opacity: 0;
|
|
20
|
-
-webkit-transition: opacity 0.5s;
|
|
21
|
-
transition: opacity 0.5s;
|
|
22
|
-
}
|
|
23
|
-
.vtx-live-player .controls .right {
|
|
24
|
-
margin-left: auto;
|
|
25
|
-
}
|
|
26
|
-
.vtx-live-player .controls .right > div {
|
|
27
|
-
height: 24px;
|
|
28
|
-
}
|
|
29
|
-
.vtx-live-player:hover .controls {
|
|
30
|
-
opacity: 1;
|
|
31
|
-
}
|
|
32
|
-
.vtx-live-player video {
|
|
33
|
-
width: 100%;
|
|
34
|
-
height: 100%;
|
|
35
|
-
-o-object-fit: fill;
|
|
36
|
-
object-fit: fill;
|
|
37
|
-
}
|
|
38
|
-
.vtx-live-player .sub-wnd {
|
|
39
|
-
width: 100% !important;
|
|
40
|
-
height: 100% !important;
|
|
41
|
-
background-color: #2b3d51 !important;
|
|
42
|
-
border: 1px solid transparent !important;
|
|
43
|
-
}
|
|
44
|
-
.vtx-live-player .error-container {
|
|
45
|
-
position: absolute;
|
|
46
|
-
top: 50%;
|
|
47
|
-
left: 50%;
|
|
48
|
-
display: -webkit-box;
|
|
49
|
-
display: -ms-flexbox;
|
|
50
|
-
display: flex;
|
|
51
|
-
-webkit-box-orient: vertical;
|
|
52
|
-
-webkit-box-direction: normal;
|
|
53
|
-
-ms-flex-direction: column;
|
|
54
|
-
flex-direction: column;
|
|
55
|
-
-webkit-box-align: center;
|
|
56
|
-
-ms-flex-align: center;
|
|
57
|
-
align-items: center;
|
|
58
|
-
-webkit-transform: translate(-50%, -50%);
|
|
59
|
-
-ms-transform: translate(-50%, -50%);
|
|
60
|
-
transform: translate(-50%, -50%);
|
|
61
|
-
}
|
|
62
|
-
.vtx-live-player .error-container .text {
|
|
63
|
-
margin: 20px 0;
|
|
64
|
-
font-size: 14px;
|
|
65
|
-
color: rgba(255, 255, 255, 0.65);
|
|
66
|
-
}
|
|
67
|
-
.vtx-live-player .loading-container {
|
|
68
|
-
position: absolute;
|
|
69
|
-
top: 50%;
|
|
70
|
-
left: 50%;
|
|
71
|
-
-webkit-transform: translate(-50%, -50%);
|
|
72
|
-
-ms-transform: translate(-50%, -50%);
|
|
73
|
-
transform: translate(-50%, -50%);
|
|
74
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["live-player-image/style/index.js"],"sourcesContent":["import \"antd/lib/space/style\";\nimport '../../controls/style';\nimport './index.less';\n"],"mappings":";;AAAA;;AACA;;AACA"}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
.vtx-live-player {
|
|
2
|
-
position: relative;
|
|
3
|
-
// display: flex;
|
|
4
|
-
// align-items: center;
|
|
5
|
-
// justify-content: center;
|
|
6
|
-
background-color: #2b3d51;
|
|
7
|
-
border: 1px solid transparent;
|
|
8
|
-
.controls {
|
|
9
|
-
position: absolute;
|
|
10
|
-
bottom: 0;
|
|
11
|
-
display: flex;
|
|
12
|
-
align-items: center;
|
|
13
|
-
width: 100%;
|
|
14
|
-
height: 30px;
|
|
15
|
-
padding: 0 12px;
|
|
16
|
-
background-color: #131d27;
|
|
17
|
-
opacity: 0;
|
|
18
|
-
transition: opacity 0.5s;
|
|
19
|
-
|
|
20
|
-
.right {
|
|
21
|
-
margin-left: auto;
|
|
22
|
-
|
|
23
|
-
> div {
|
|
24
|
-
height: 24px;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
&:hover {
|
|
30
|
-
.controls {
|
|
31
|
-
opacity: 1;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
video {
|
|
36
|
-
width: 100%;
|
|
37
|
-
height: 100%;
|
|
38
|
-
object-fit: fill;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.sub-wnd {
|
|
42
|
-
width: 100% !important;
|
|
43
|
-
height: 100% !important;
|
|
44
|
-
background-color: #2b3d51 !important;
|
|
45
|
-
border: 1px solid transparent !important;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
.error-container {
|
|
49
|
-
position: absolute;
|
|
50
|
-
top: 50%;
|
|
51
|
-
left: 50%;
|
|
52
|
-
display: flex;
|
|
53
|
-
flex-direction: column;
|
|
54
|
-
align-items: center;
|
|
55
|
-
transform: translate(-50%, -50%);
|
|
56
|
-
|
|
57
|
-
.text {
|
|
58
|
-
margin: 20px 0;
|
|
59
|
-
font-size: 14px;
|
|
60
|
-
color: rgba(255, 255 ,255 , .65);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
.loading-container {
|
|
65
|
-
position: absolute;
|
|
66
|
-
top: 50%;
|
|
67
|
-
left: 50%;
|
|
68
|
-
transform: translate(-50%, -50%);
|
|
69
|
-
}
|
|
70
|
-
}
|