@desynova-digital/player 3.9.7 → 4.0.1
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/Player.js +945 -0
- package/control/AudioTracksMenuButton.js +91 -0
- package/control/AudioTracksMenuButton.jsx +80 -0
- package/control/ControlBar.js +303 -0
- package/control/ControlBar.jsx +264 -0
- package/control/CurrentTimeDisplay.js +34 -0
- package/control/CurrentTimeDisplay.jsx +35 -0
- package/control/DurationDisplay.js +38 -0
- package/control/DurationDisplay.jsx +48 -0
- package/control/ForwardBackwardControl.js +76 -0
- package/control/ForwardBackwardControl.jsx +79 -0
- package/control/FullscreenToggle.js +82 -0
- package/control/FullscreenToggle.jsx +83 -0
- package/control/MarkInControl.js +124 -0
- package/control/MarkInControl.jsx +109 -0
- package/control/MarkOutControl.js +137 -0
- package/control/MarkOutControl.jsx +131 -0
- package/control/MarkerBar.js +127 -0
- package/control/MarkerBar.jsx +107 -0
- package/control/MarkingControl.js +82 -0
- package/control/MarkingControl.jsx +143 -0
- package/control/MarkingDuration.js +44 -0
- package/control/MarkingPreview.js +49 -0
- package/control/MarkingPreview.jsx +60 -0
- package/control/PlayBackRateControl.js +106 -0
- package/control/PlayBackRateControl.jsx +106 -0
- package/control/PlayProgressBar.js +61 -0
- package/control/PlayProgressBar.jsx +92 -0
- package/control/PlayToggle.js +56 -0
- package/control/PlayToggle.jsx +57 -0
- package/control/PointersBar.js +231 -0
- package/control/PointersBar.jsx +286 -0
- package/control/ProgressControl.js +127 -0
- package/control/ProgressControl.jsx +155 -0
- package/control/SeekBar.js +204 -0
- package/control/SeekBar.jsx +229 -0
- package/control/SettingsMenuButton.js +63 -0
- package/control/SettingsMenuButton.jsx +69 -0
- package/control/Slider.js +274 -0
- package/control/Slider.jsx +243 -0
- package/control/Timeline.js +118 -0
- package/control/Timeline.jsx +131 -0
- package/control/VolumeBar.js +198 -0
- package/control/VolumeBar.jsx +174 -0
- package/control/VolumeLevel.js +61 -0
- package/control/VolumeLevel.jsx +66 -0
- package/control/VolumneMenuButton.js +112 -0
- package/control/VolumneMenuButton.jsx +111 -0
- package/header/Header.js +309 -0
- package/header/Header.jsx +479 -0
- package/index.js +9 -151
- package/media/AudioMeter.js +381 -0
- package/media/AudioMeter.jsx +411 -0
- package/media/SDOutline.js +82 -0
- package/media/SDOutline.jsx +90 -0
- package/media/Video.js +684 -0
- package/media/Video.jsx +714 -0
- package/package.json +5 -1
- package/playlist/Playlist.js +67 -0
- package/playlist/Playlist.jsx +91 -0
- package/playlist/index.js +13 -0
- package/shortcuts/Shortcut.js +662 -0
- package/utils/Menu.js +50 -0
- package/utils/Menu.jsx +105 -0
- package/{colors.js → utils/colors.js} +13 -13
- package/utils/dom.js +6 -16
- package/utils/index.js +52 -122
- package/Manager.js +0 -124
- package/actions/player.js +0 -375
- package/actions/video.js +0 -230
- package/components/AudioMeter.js +0 -414
- package/components/BigPlayButton.js +0 -110
- package/components/ImageViewer.js +0 -318
- package/components/MarkerBar.js +0 -138
- package/components/Menu.js +0 -77
- package/components/Player.js +0 -821
- package/components/PlayerHeader.js +0 -472
- package/components/Playlist.js +0 -133
- package/components/PointersBar.js +0 -299
- package/components/PosterImage.js +0 -61
- package/components/SDOutline.js +0 -68
- package/components/Shortcut.js +0 -621
- package/components/Slider.js +0 -317
- package/components/TagsBar.js +0 -100
- package/components/Video.js +0 -1431
- package/components/control-bar/AudioTracksMenuButton.js +0 -113
- package/components/control-bar/CameraButton.js +0 -88
- package/components/control-bar/CommentsButton.js +0 -216
- package/components/control-bar/ControlBar.js +0 -260
- package/components/control-bar/EditorControlMenuButton.js +0 -412
- package/components/control-bar/ForwardControl.js +0 -17
- package/components/control-bar/ForwardReplayControl.js +0 -122
- package/components/control-bar/FullscreenToggle.js +0 -101
- package/components/control-bar/PlayToggle.js +0 -98
- package/components/control-bar/ReplayControl.js +0 -17
- package/components/control-bar/SettingsMenuButton.js +0 -43
- package/components/control-bar/SubtitleLanguagesMenuButton.js +0 -174
- package/components/control-bar/VolumeMenuButton.js +0 -134
- package/components/control-bar/ZoomMenuButton.js +0 -116
- package/components/marking-controls/MarkInControl.js +0 -140
- package/components/marking-controls/MarkOutControl.js +0 -155
- package/components/marking-controls/MarkingAddButton.js +0 -94
- package/components/marking-controls/MarkingControl.js +0 -135
- package/components/marking-controls/MarkingDeleteButton.js +0 -84
- package/components/marking-controls/MarkingDuration.js +0 -77
- package/components/marking-controls/MarkingPreview.js +0 -86
- package/components/progress-bar/AudioWaveform.js +0 -144
- package/components/progress-bar/LoadProgressBar.js +0 -90
- package/components/progress-bar/MouseTimeDisplay.js +0 -53
- package/components/progress-bar/PlayProgressBar.js +0 -79
- package/components/progress-bar/ProgressControl.js +0 -222
- package/components/progress-bar/SeekBar.js +0 -261
- package/components/progress-bar/Timeline.js +0 -134
- package/components/settings-menu-control/PlaybackRateControl.js +0 -147
- package/components/settings-menu-control/SafeAreaControl.js +0 -92
- package/components/settings-menu-control/SettingsMenu.js +0 -68
- package/components/settings-menu-control/SubtitleControl.js +0 -1
- package/components/time-controls/CurrentTimeDisplay.js +0 -53
- package/components/time-controls/DurationDisplay.js +0 -51
- package/components/time-controls/TimeDivider.js +0 -41
- package/components/volume-control/VolumeBar.js +0 -216
- package/components/volume-control/VolumeControl.js +0 -35
- package/components/volume-control/VolumeLevel.js +0 -78
- package/components/zoom-control/ZoomBar.js +0 -189
- package/components/zoom-control/ZoomLevel.js +0 -68
- package/reducers/index.js +0 -23
- package/reducers/operation.js +0 -36
- package/reducers/player.js +0 -222
- package/utils/browser.js +0 -29
- package/utils/fullscreen.js +0 -73
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { PropTypes } from 'prop-types';
|
|
2
|
+
import React, { Component } from 'react';
|
|
3
|
+
import { findDOMNode } from 'react-dom';
|
|
4
|
+
import styled from 'styled-components';
|
|
5
|
+
import * as Dom from '../utils/dom';
|
|
6
|
+
import SeekBar from './SeekBar';
|
|
7
|
+
import PointersBar from './PointersBar';
|
|
8
|
+
import colors from '../utils/colors';
|
|
9
|
+
|
|
10
|
+
const propTypes = {
|
|
11
|
+
player: PropTypes.instanceOf(Object),
|
|
12
|
+
controlType: PropTypes.string,
|
|
13
|
+
playerType: PropTypes.oneOf([
|
|
14
|
+
'dubbing_review',
|
|
15
|
+
'clipping_default',
|
|
16
|
+
'default',
|
|
17
|
+
'tagging',
|
|
18
|
+
'qc',
|
|
19
|
+
'subtitle',
|
|
20
|
+
'snp_edit',
|
|
21
|
+
'archive',
|
|
22
|
+
'restore',
|
|
23
|
+
'clipping',
|
|
24
|
+
'storyboard',
|
|
25
|
+
'panel'
|
|
26
|
+
])
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const defaultProps = {};
|
|
30
|
+
|
|
31
|
+
const ProgressControlBlock = styled.div`
|
|
32
|
+
width: 100%;
|
|
33
|
+
height: ${(props) => (props.controlType === 'advanced' && !props.isFullscreen ? '80px' : '4px')};
|
|
34
|
+
position: relative;
|
|
35
|
+
overflow: ${(props) => (props.controlType === 'advanced' && !props.isFullscreen ? 'none' : 'visible')};
|
|
36
|
+
padding-top: 0px;
|
|
37
|
+
background: #000000;
|
|
38
|
+
background: ${colors.common.base.black};
|
|
39
|
+
display: flex;
|
|
40
|
+
justify-content: center;
|
|
41
|
+
align-items: center;
|
|
42
|
+
transition: all 250ms ease-in-out;
|
|
43
|
+
bottom: ${(props) => (props.player === 'panel' && props.active ? '50px' : 'initial')};
|
|
44
|
+
`;
|
|
45
|
+
|
|
46
|
+
const SeekControlBar = styled.div`
|
|
47
|
+
width: 100%;
|
|
48
|
+
height: 100%;
|
|
49
|
+
position: relative;
|
|
50
|
+
cursor: pointer;
|
|
51
|
+
z-index: ${(props) => (props.controlType === 'advanced' && !props.isFullscreen ? '2' : '1')};
|
|
52
|
+
`;
|
|
53
|
+
|
|
54
|
+
const MarkerTagsBlock = styled.div`
|
|
55
|
+
min-width: 100px;
|
|
56
|
+
max-width: 100px;
|
|
57
|
+
position: relative;
|
|
58
|
+
height: 100%;
|
|
59
|
+
.empty-block {
|
|
60
|
+
height: calc(100% - 20px);
|
|
61
|
+
}
|
|
62
|
+
.tags-block {
|
|
63
|
+
height: 20px;
|
|
64
|
+
font-family: SFUIText-Medium;
|
|
65
|
+
font-size: 12px;
|
|
66
|
+
color: #ffffff;
|
|
67
|
+
text-transform: uppercase;
|
|
68
|
+
border-top: 1px solid #333333;
|
|
69
|
+
border-bottom: 1px solid #333333;
|
|
70
|
+
p {
|
|
71
|
+
line-height: 18px;
|
|
72
|
+
padding-left: 10px;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
`;
|
|
76
|
+
|
|
77
|
+
export default class ProgressControl extends Component {
|
|
78
|
+
constructor(props, context) {
|
|
79
|
+
super(props, context);
|
|
80
|
+
|
|
81
|
+
this.state = {
|
|
82
|
+
mouseTime: {
|
|
83
|
+
time: null,
|
|
84
|
+
position: 0,
|
|
85
|
+
stateZoom: null
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
this.handleMouseMoveThrottle = this.handleMouseMove.bind(this);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
handleMouseMove(event) {
|
|
93
|
+
// if (!event.pageX) {
|
|
94
|
+
// return;
|
|
95
|
+
// }
|
|
96
|
+
// const {
|
|
97
|
+
// duration: { seconds }
|
|
98
|
+
// } = this.props;
|
|
99
|
+
// const node = findDOMNode(this.seekBar);
|
|
100
|
+
// const newTime = Dom.getPointerPosition(node, event).x * seconds;
|
|
101
|
+
// const position = event.pageX - Dom.findElPosition(node).left;
|
|
102
|
+
// this.setState({
|
|
103
|
+
// mouseTime: {
|
|
104
|
+
// time: newTime,
|
|
105
|
+
// position
|
|
106
|
+
// }
|
|
107
|
+
// });
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
render() {
|
|
111
|
+
const { controlType, playerType, isFullscreen, userActivity } = this.props;
|
|
112
|
+
const { mouseTime } = this.state;
|
|
113
|
+
return (
|
|
114
|
+
<React.Fragment>
|
|
115
|
+
<ProgressControlBlock
|
|
116
|
+
controlType={controlType}
|
|
117
|
+
player={playerType}
|
|
118
|
+
active={userActivity}
|
|
119
|
+
isFullscreen={isFullscreen}
|
|
120
|
+
ref={(c) => {
|
|
121
|
+
this.progressControlBlock = c;
|
|
122
|
+
}}>
|
|
123
|
+
{controlType === 'advanced' && !isFullscreen ? (
|
|
124
|
+
<MarkerTagsBlock>
|
|
125
|
+
<div className="empty-block" />
|
|
126
|
+
</MarkerTagsBlock>
|
|
127
|
+
) : null}
|
|
128
|
+
<SeekControlBar
|
|
129
|
+
ref={(c) => {
|
|
130
|
+
this.seekControlBar = c;
|
|
131
|
+
}}
|
|
132
|
+
onMouseMove={this.handleMouseMoveThrottle}>
|
|
133
|
+
<SeekBar
|
|
134
|
+
mouseTime={mouseTime}
|
|
135
|
+
ref={(c) => {
|
|
136
|
+
this.seekBar = c;
|
|
137
|
+
}}
|
|
138
|
+
{...this.props}
|
|
139
|
+
/>
|
|
140
|
+
</SeekControlBar>
|
|
141
|
+
{controlType === 'advanced' && !isFullscreen ? (
|
|
142
|
+
<MarkerTagsBlock>
|
|
143
|
+
<div className="empty-block" />
|
|
144
|
+
</MarkerTagsBlock>
|
|
145
|
+
) : null}
|
|
146
|
+
</ProgressControlBlock>
|
|
147
|
+
{controlType === 'advanced' && !isFullscreen ? <PointersBar {...this.props} /> : null}
|
|
148
|
+
</React.Fragment>
|
|
149
|
+
);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
ProgressControl.propTypes = propTypes;
|
|
154
|
+
ProgressControl.defaultProps = defaultProps;
|
|
155
|
+
ProgressControl.displayName = 'ProgressControl';
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports["default"] = void 0;
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
10
|
+
var _propTypes = require("prop-types");
|
|
11
|
+
var _Slider = _interopRequireDefault(require("./Slider"));
|
|
12
|
+
var _PlayProgressBar = _interopRequireDefault(require("./PlayProgressBar"));
|
|
13
|
+
var _utils = require("../utils");
|
|
14
|
+
var _Timeline = _interopRequireDefault(require("./Timeline"));
|
|
15
|
+
var _MarkerBar = _interopRequireDefault(require("./MarkerBar"));
|
|
16
|
+
var _templateObject, _templateObject2;
|
|
17
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
18
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
19
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
20
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
21
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
22
|
+
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, _toPropertyKey(descriptor.key), descriptor); } }
|
|
23
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
24
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
25
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
26
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
27
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
28
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
29
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
30
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
31
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
32
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
33
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
34
|
+
// import TagsBar from '../TagsBar';
|
|
35
|
+
// import MouseTimeDisplay from './MouseTimeDisplay';
|
|
36
|
+
|
|
37
|
+
var AdvancedControlBlock = _styledComponents["default"].div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: 100%;\n height: 46px;\n position: relative;\n cursor: pointer;\n z-index: 1;\n"])));
|
|
38
|
+
var SliderBlock = _styledComponents["default"].div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n width: 100%;\n height: 4px;\n position: relative;\n cursor: pointer;\n z-index: 2;\n"])));
|
|
39
|
+
var propTypes = {
|
|
40
|
+
actions: _propTypes.PropTypes.instanceOf(Object),
|
|
41
|
+
player: _propTypes.PropTypes.instanceOf(Object),
|
|
42
|
+
controlType: _propTypes.PropTypes.string,
|
|
43
|
+
tagsMarker: _propTypes.PropTypes.instanceOf(Array),
|
|
44
|
+
mouseTime: _propTypes.PropTypes.instanceOf(Object),
|
|
45
|
+
assetType: _propTypes.PropTypes.oneOf(['fc', 'rc']),
|
|
46
|
+
playerType: _propTypes.PropTypes.oneOf(['dubbing_review', 'clipping_default', 'default', 'tagging', 'qc', 'subtitle', 'snp_edit', 'archive', 'restore', 'clipping', 'storyboard', 'panel'])
|
|
47
|
+
};
|
|
48
|
+
var SeekBar = /*#__PURE__*/function (_Component) {
|
|
49
|
+
_inherits(SeekBar, _Component);
|
|
50
|
+
var _super = _createSuper(SeekBar);
|
|
51
|
+
function SeekBar(props, context) {
|
|
52
|
+
var _this;
|
|
53
|
+
_classCallCheck(this, SeekBar);
|
|
54
|
+
_this = _super.call(this, props, context);
|
|
55
|
+
_this.getPercent = _this.getPercent.bind(_assertThisInitialized(_this));
|
|
56
|
+
_this.getNewTime = _this.getNewTime.bind(_assertThisInitialized(_this));
|
|
57
|
+
_this.stepForward = _this.stepForward.bind(_assertThisInitialized(_this));
|
|
58
|
+
_this.stepBack = _this.stepBack.bind(_assertThisInitialized(_this));
|
|
59
|
+
_this.handleMouseDown = _this.handleMouseDown.bind(_assertThisInitialized(_this));
|
|
60
|
+
_this.handleMouseMove = _this.handleMouseMove.bind(_assertThisInitialized(_this));
|
|
61
|
+
_this.handleMouseUp = _this.handleMouseUp.bind(_assertThisInitialized(_this));
|
|
62
|
+
_this.state = {
|
|
63
|
+
sliderActive: false
|
|
64
|
+
};
|
|
65
|
+
return _this;
|
|
66
|
+
}
|
|
67
|
+
_createClass(SeekBar, [{
|
|
68
|
+
key: "componentDidMount",
|
|
69
|
+
value: function componentDidMount() {}
|
|
70
|
+
}, {
|
|
71
|
+
key: "componentDidUpdate",
|
|
72
|
+
value: function componentDidUpdate() {}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Get percentage of video played
|
|
76
|
+
*
|
|
77
|
+
* @return {Number} Percentage played
|
|
78
|
+
* @method getPercent
|
|
79
|
+
*/
|
|
80
|
+
}, {
|
|
81
|
+
key: "getPercent",
|
|
82
|
+
value: function getPercent() {
|
|
83
|
+
var _this$props = this.props,
|
|
84
|
+
seconds = _this$props.currentTime.seconds,
|
|
85
|
+
seekingTime = _this$props.seekingTime,
|
|
86
|
+
duration = _this$props.duration;
|
|
87
|
+
var time = seekingTime || seconds;
|
|
88
|
+
var percent = time / duration.seconds;
|
|
89
|
+
return percent >= 1 ? 1 : percent;
|
|
90
|
+
}
|
|
91
|
+
}, {
|
|
92
|
+
key: "getNewTime",
|
|
93
|
+
value: function getNewTime(event) {
|
|
94
|
+
var seconds = this.props.duration.seconds;
|
|
95
|
+
var distance = this.slider.calculateDistance(event);
|
|
96
|
+
var newTime = distance * seconds;
|
|
97
|
+
|
|
98
|
+
// Don't let video end while scrubbing.
|
|
99
|
+
return newTime === seconds ? newTime - 0.1 : newTime;
|
|
100
|
+
}
|
|
101
|
+
}, {
|
|
102
|
+
key: "handleMouseDown",
|
|
103
|
+
value: function handleMouseDown() {
|
|
104
|
+
console.log('handleMouse handleMouseDown');
|
|
105
|
+
this.setState({
|
|
106
|
+
sliderActive: true
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
}, {
|
|
110
|
+
key: "handleMouseUp",
|
|
111
|
+
value: function handleMouseUp(event) {
|
|
112
|
+
console.log('handleMouse handleMouseUp');
|
|
113
|
+
var actionClick = this.props.actionClick;
|
|
114
|
+
var newTime = this.getNewTime(event);
|
|
115
|
+
// Set new time (tell video to seek to new time)
|
|
116
|
+
actionClick({
|
|
117
|
+
action: 'seek',
|
|
118
|
+
value: newTime
|
|
119
|
+
});
|
|
120
|
+
// actions.handleEndSeeking(newTime);//todo check if needed
|
|
121
|
+
this.setState({
|
|
122
|
+
sliderActive: false
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
}, {
|
|
126
|
+
key: "handleMouseMove",
|
|
127
|
+
value: function handleMouseMove(event) {
|
|
128
|
+
var sliderActive = this.state.sliderActive;
|
|
129
|
+
if (sliderActive) {
|
|
130
|
+
var actionClick = this.props.actionClick;
|
|
131
|
+
var newTime = this.getNewTime(event);
|
|
132
|
+
actionClick({
|
|
133
|
+
action: 'seeking_time',
|
|
134
|
+
value: newTime
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}, {
|
|
139
|
+
key: "stepForward",
|
|
140
|
+
value: function stepForward() {
|
|
141
|
+
var actionClick = this.props.actionClick;
|
|
142
|
+
actionClick({
|
|
143
|
+
action: 'add_seconds',
|
|
144
|
+
value: '0.04'
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
}, {
|
|
148
|
+
key: "stepBack",
|
|
149
|
+
value: function stepBack() {
|
|
150
|
+
var actionClick = this.props.actionClick;
|
|
151
|
+
actionClick({
|
|
152
|
+
action: 'add_seconds',
|
|
153
|
+
value: '-0.04'
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
}, {
|
|
157
|
+
key: "render",
|
|
158
|
+
value: function render() {
|
|
159
|
+
var _this2 = this;
|
|
160
|
+
var _this$props2 = this.props,
|
|
161
|
+
seconds = _this$props2.currentTime.seconds,
|
|
162
|
+
seekingTime = _this$props2.seekingTime,
|
|
163
|
+
duration = _this$props2.duration,
|
|
164
|
+
isFullscreen = _this$props2.isFullscreen,
|
|
165
|
+
controlType = _this$props2.controlType,
|
|
166
|
+
playerType = _this$props2.playerType,
|
|
167
|
+
tagsMarker = _this$props2.tagsMarker,
|
|
168
|
+
assetType = _this$props2.assetType;
|
|
169
|
+
var time = seekingTime || seconds;
|
|
170
|
+
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_MarkerBar["default"], this.props), /*#__PURE__*/_react["default"].createElement("div", {
|
|
171
|
+
onMouseDown: this.handleMouseDown,
|
|
172
|
+
onMouseMove: this.handleMouseMove,
|
|
173
|
+
onMouseUp: this.handleMouseUp
|
|
174
|
+
}, /*#__PURE__*/_react["default"].createElement(SliderBlock, null, /*#__PURE__*/_react["default"].createElement(_Slider["default"], {
|
|
175
|
+
ref: function ref(input) {
|
|
176
|
+
_this2.slider = input;
|
|
177
|
+
},
|
|
178
|
+
label: "video progress bar",
|
|
179
|
+
valuenow: (this.getPercent() * 100).toFixed(2),
|
|
180
|
+
valuetext: (0, _utils.formatTime)(time, duration.seconds)
|
|
181
|
+
// onMouseDown={this.handleMouseDown}
|
|
182
|
+
// onMouseMove={this.handleMouseMove}
|
|
183
|
+
// onMouseUp={this.handleMouseUp}
|
|
184
|
+
,
|
|
185
|
+
getPercent: this.getPercent,
|
|
186
|
+
stepForward: this.stepForward,
|
|
187
|
+
stepBack: this.stepBack
|
|
188
|
+
}, /*#__PURE__*/_react["default"].createElement(_PlayProgressBar["default"], _extends({
|
|
189
|
+
currentTime: time,
|
|
190
|
+
duration: duration.seconds,
|
|
191
|
+
playerType: playerType,
|
|
192
|
+
assetType: assetType
|
|
193
|
+
}, this.props)))), controlType === 'advanced' && !isFullscreen ? /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(AdvancedControlBlock, null, /*#__PURE__*/_react["default"].createElement(_Timeline["default"], _extends({}, this.props, {
|
|
194
|
+
ref: function ref(c) {
|
|
195
|
+
_this2.timeline = c;
|
|
196
|
+
}
|
|
197
|
+
})))) : null));
|
|
198
|
+
}
|
|
199
|
+
}]);
|
|
200
|
+
return SeekBar;
|
|
201
|
+
}(_react.Component);
|
|
202
|
+
exports["default"] = SeekBar;
|
|
203
|
+
SeekBar.displayName = 'SeekBar';
|
|
204
|
+
SeekBar.propTypes = propTypes;
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
import React, { Component } from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
import { PropTypes } from 'prop-types';
|
|
4
|
+
|
|
5
|
+
// import AudioWaveform from './AudioWaveform';
|
|
6
|
+
import Slider from './Slider';
|
|
7
|
+
import PlayProgressBar from './PlayProgressBar';
|
|
8
|
+
import { formatTime } from '../utils';
|
|
9
|
+
import Timeline from './Timeline';
|
|
10
|
+
import MarkerBar from './MarkerBar';
|
|
11
|
+
// import TagsBar from '../TagsBar';
|
|
12
|
+
// import MouseTimeDisplay from './MouseTimeDisplay';
|
|
13
|
+
|
|
14
|
+
const AdvancedControlBlock = styled.div`
|
|
15
|
+
width: 100%;
|
|
16
|
+
height: 46px;
|
|
17
|
+
position: relative;
|
|
18
|
+
cursor: pointer;
|
|
19
|
+
z-index: 1;
|
|
20
|
+
`;
|
|
21
|
+
|
|
22
|
+
const SliderBlock = styled.div`
|
|
23
|
+
width: 100%;
|
|
24
|
+
height: 4px;
|
|
25
|
+
position: relative;
|
|
26
|
+
cursor: pointer;
|
|
27
|
+
z-index: 2;
|
|
28
|
+
`;
|
|
29
|
+
|
|
30
|
+
const propTypes = {
|
|
31
|
+
actions: PropTypes.instanceOf(Object),
|
|
32
|
+
player: PropTypes.instanceOf(Object),
|
|
33
|
+
controlType: PropTypes.string,
|
|
34
|
+
tagsMarker: PropTypes.instanceOf(Array),
|
|
35
|
+
mouseTime: PropTypes.instanceOf(Object),
|
|
36
|
+
assetType: PropTypes.oneOf(['fc', 'rc']),
|
|
37
|
+
playerType: PropTypes.oneOf([
|
|
38
|
+
'dubbing_review',
|
|
39
|
+
'clipping_default',
|
|
40
|
+
'default',
|
|
41
|
+
'tagging',
|
|
42
|
+
'qc',
|
|
43
|
+
'subtitle',
|
|
44
|
+
'snp_edit',
|
|
45
|
+
'archive',
|
|
46
|
+
'restore',
|
|
47
|
+
'clipping',
|
|
48
|
+
'storyboard',
|
|
49
|
+
'panel'
|
|
50
|
+
])
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export default class SeekBar extends Component {
|
|
54
|
+
constructor(props, context) {
|
|
55
|
+
super(props, context);
|
|
56
|
+
|
|
57
|
+
this.getPercent = this.getPercent.bind(this);
|
|
58
|
+
this.getNewTime = this.getNewTime.bind(this);
|
|
59
|
+
this.stepForward = this.stepForward.bind(this);
|
|
60
|
+
this.stepBack = this.stepBack.bind(this);
|
|
61
|
+
|
|
62
|
+
this.handleMouseDown = this.handleMouseDown.bind(this);
|
|
63
|
+
this.handleMouseMove = this.handleMouseMove.bind(this);
|
|
64
|
+
this.handleMouseUp = this.handleMouseUp.bind(this);
|
|
65
|
+
|
|
66
|
+
this.state = {
|
|
67
|
+
sliderActive: false
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
componentDidMount() {}
|
|
72
|
+
|
|
73
|
+
componentDidUpdate() {}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Get percentage of video played
|
|
77
|
+
*
|
|
78
|
+
* @return {Number} Percentage played
|
|
79
|
+
* @method getPercent
|
|
80
|
+
*/
|
|
81
|
+
getPercent() {
|
|
82
|
+
const {
|
|
83
|
+
currentTime: { seconds },
|
|
84
|
+
seekingTime,
|
|
85
|
+
duration
|
|
86
|
+
} = this.props;
|
|
87
|
+
const time = seekingTime || seconds;
|
|
88
|
+
const percent = time / duration.seconds;
|
|
89
|
+
return percent >= 1 ? 1 : percent;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
getNewTime(event) {
|
|
93
|
+
const {
|
|
94
|
+
duration: { seconds }
|
|
95
|
+
} = this.props;
|
|
96
|
+
const distance = this.slider.calculateDistance(event);
|
|
97
|
+
const newTime = distance * seconds;
|
|
98
|
+
|
|
99
|
+
// Don't let video end while scrubbing.
|
|
100
|
+
return newTime === seconds ? newTime - 0.1 : newTime;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
handleMouseDown() {
|
|
104
|
+
console.log('handleMouse handleMouseDown');
|
|
105
|
+
this.setState({ sliderActive: true });
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
handleMouseUp(event) {
|
|
109
|
+
console.log('handleMouse handleMouseUp');
|
|
110
|
+
const { actionClick } = this.props;
|
|
111
|
+
const newTime = this.getNewTime(event);
|
|
112
|
+
// Set new time (tell video to seek to new time)
|
|
113
|
+
actionClick({
|
|
114
|
+
action: 'seek',
|
|
115
|
+
value: newTime
|
|
116
|
+
});
|
|
117
|
+
// actions.handleEndSeeking(newTime);//todo check if needed
|
|
118
|
+
this.setState({ sliderActive: false });
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
handleMouseMove(event) {
|
|
122
|
+
const { sliderActive } = this.state;
|
|
123
|
+
if (sliderActive) {
|
|
124
|
+
const { actionClick } = this.props;
|
|
125
|
+
const newTime = this.getNewTime(event);
|
|
126
|
+
actionClick({
|
|
127
|
+
action: 'seeking_time',
|
|
128
|
+
value: newTime
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
stepForward() {
|
|
134
|
+
const { actionClick } = this.props;
|
|
135
|
+
actionClick({
|
|
136
|
+
action: 'add_seconds',
|
|
137
|
+
value: '0.04'
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
stepBack() {
|
|
142
|
+
const { actionClick } = this.props;
|
|
143
|
+
actionClick({
|
|
144
|
+
action: 'add_seconds',
|
|
145
|
+
value: '-0.04'
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
render() {
|
|
150
|
+
const {
|
|
151
|
+
currentTime: { seconds },
|
|
152
|
+
seekingTime,
|
|
153
|
+
duration,
|
|
154
|
+
isFullscreen,
|
|
155
|
+
controlType,
|
|
156
|
+
playerType,
|
|
157
|
+
tagsMarker,
|
|
158
|
+
assetType
|
|
159
|
+
// mouseTime
|
|
160
|
+
} = this.props;
|
|
161
|
+
const time = seekingTime || seconds;
|
|
162
|
+
return (
|
|
163
|
+
<React.Fragment>
|
|
164
|
+
<MarkerBar {...this.props} />
|
|
165
|
+
{/* {tagsMarker && tagsMarker.length ? <TagsBar {...this.props} /> : null} */}
|
|
166
|
+
{/* {controlType === 'advanced' ? <MarkerBar {...this.props} /> : null} */}
|
|
167
|
+
<div onMouseDown={this.handleMouseDown} onMouseMove={this.handleMouseMove} onMouseUp={this.handleMouseUp}>
|
|
168
|
+
<SliderBlock>
|
|
169
|
+
<Slider
|
|
170
|
+
ref={(input) => {
|
|
171
|
+
this.slider = input;
|
|
172
|
+
}}
|
|
173
|
+
label="video progress bar"
|
|
174
|
+
valuenow={(this.getPercent() * 100).toFixed(2)}
|
|
175
|
+
valuetext={formatTime(time, duration.seconds)}
|
|
176
|
+
// onMouseDown={this.handleMouseDown}
|
|
177
|
+
// onMouseMove={this.handleMouseMove}
|
|
178
|
+
// onMouseUp={this.handleMouseUp}
|
|
179
|
+
getPercent={this.getPercent}
|
|
180
|
+
stepForward={this.stepForward}
|
|
181
|
+
stepBack={this.stepBack}>
|
|
182
|
+
{/* <LoadProgressBar
|
|
183
|
+
buffered={buffered}
|
|
184
|
+
currentTime={time}
|
|
185
|
+
duration={duration}
|
|
186
|
+
playerType={this.props.playerType}
|
|
187
|
+
/>
|
|
188
|
+
<MouseTimeDisplay
|
|
189
|
+
duration={duration}
|
|
190
|
+
mouseTime={mouseTime}
|
|
191
|
+
playerType={playerType}
|
|
192
|
+
/>*/}
|
|
193
|
+
<PlayProgressBar
|
|
194
|
+
currentTime={time}
|
|
195
|
+
duration={duration.seconds}
|
|
196
|
+
playerType={playerType}
|
|
197
|
+
assetType={assetType}
|
|
198
|
+
{...this.props}
|
|
199
|
+
/>
|
|
200
|
+
</Slider>
|
|
201
|
+
</SliderBlock>
|
|
202
|
+
{controlType === 'advanced' && !isFullscreen ? (
|
|
203
|
+
<React.Fragment>
|
|
204
|
+
<AdvancedControlBlock>
|
|
205
|
+
{/*
|
|
206
|
+
<AudioWaveform
|
|
207
|
+
{...this.props}
|
|
208
|
+
ref={(c) => {
|
|
209
|
+
this.audioWaveform = c;
|
|
210
|
+
}}
|
|
211
|
+
/>
|
|
212
|
+
*/}
|
|
213
|
+
<Timeline
|
|
214
|
+
{...this.props}
|
|
215
|
+
ref={(c) => {
|
|
216
|
+
this.timeline = c;
|
|
217
|
+
}}
|
|
218
|
+
/>
|
|
219
|
+
</AdvancedControlBlock>
|
|
220
|
+
</React.Fragment>
|
|
221
|
+
) : null}
|
|
222
|
+
</div>
|
|
223
|
+
</React.Fragment>
|
|
224
|
+
);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
SeekBar.displayName = 'SeekBar';
|
|
229
|
+
SeekBar.propTypes = propTypes;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = SettingsMenuButton;
|
|
7
|
+
var _propTypes = require("prop-types");
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
10
|
+
var _Menu = _interopRequireDefault(require("../utils/Menu"));
|
|
11
|
+
var _components = require("@desynova-digital/components");
|
|
12
|
+
var _PlayBackRateControl = _interopRequireDefault(require("./PlayBackRateControl"));
|
|
13
|
+
var _templateObject, _templateObject2;
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
15
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
16
|
+
var propTypes = {
|
|
17
|
+
player: _propTypes.PropTypes.instanceOf(Object),
|
|
18
|
+
actions: _propTypes.PropTypes.instanceOf(Object),
|
|
19
|
+
style: _propTypes.PropTypes.instanceOf(Object)
|
|
20
|
+
};
|
|
21
|
+
var SettingsMenuContainer = _styledComponents["default"].div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: 100%;\n position: relative;\n .settings-menu-tile {\n background: transparent;\n div {\n padding: 15px;\n cursor: pointer;\n }\n }\n"])));
|
|
22
|
+
var SafeAreaBlock = (0, _styledComponents["default"])('div')(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n background: transparent;\n font-family: SFUIText-Medium;\n font-size: 12px;\n text-transform: uppercase;\n justify-content: flex-start;\n align-items: center;\n &:hover {\n background: rgba(0, 206, 198, 0.1);\n }\n p {\n margin-left: 10px;\n white-space: nowrap;\n }\n"])));
|
|
23
|
+
function SettingsMenuButton(_ref) {
|
|
24
|
+
var style = _ref.style,
|
|
25
|
+
SDBorderActive = _ref.SDBorderActive,
|
|
26
|
+
actionClick = _ref.actionClick,
|
|
27
|
+
playbackRate = _ref.playbackRate;
|
|
28
|
+
var handleClick = function handleClick() {
|
|
29
|
+
actionClick({
|
|
30
|
+
action: 'handle_sd_border_change',
|
|
31
|
+
value: !SDBorderActive
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
return /*#__PURE__*/_react["default"].createElement(_Menu["default"], {
|
|
35
|
+
icon: "settings",
|
|
36
|
+
position: "left",
|
|
37
|
+
style: style
|
|
38
|
+
}, /*#__PURE__*/_react["default"].createElement(SettingsMenuContainer, {
|
|
39
|
+
style: style
|
|
40
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
41
|
+
className: "settings-menu-tile"
|
|
42
|
+
}, /*#__PURE__*/_react["default"].createElement(SafeAreaBlock, {
|
|
43
|
+
onClick: handleClick
|
|
44
|
+
}, /*#__PURE__*/_react["default"].createElement(_components.Icon, {
|
|
45
|
+
name: "safe-area",
|
|
46
|
+
width: 20,
|
|
47
|
+
height: 20,
|
|
48
|
+
color: SDBorderActive ? '#00cec6' : '#333333'
|
|
49
|
+
}), /*#__PURE__*/_react["default"].createElement("p", {
|
|
50
|
+
style: SDBorderActive ? {
|
|
51
|
+
color: '#00cec6'
|
|
52
|
+
} : {
|
|
53
|
+
color: '#333333'
|
|
54
|
+
}
|
|
55
|
+
}, "4:3 Safe Area"))), /*#__PURE__*/_react["default"].createElement("div", {
|
|
56
|
+
className: "settings-menu-tile"
|
|
57
|
+
}, /*#__PURE__*/_react["default"].createElement(_PlayBackRateControl["default"], {
|
|
58
|
+
actionClick: actionClick,
|
|
59
|
+
playbackRate: playbackRate
|
|
60
|
+
}))));
|
|
61
|
+
}
|
|
62
|
+
SettingsMenuButton.propTypes = propTypes;
|
|
63
|
+
SettingsMenuButton.displayName = 'SettingsMenuButton';
|