aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/CollectionVideoView.tsx
diff options
context:
space:
mode:
authorMonika Hedman <monika_hedman@brown.edu>2019-04-29 19:55:28 -0400
committerMonika Hedman <monika_hedman@brown.edu>2019-04-29 19:55:28 -0400
commit53e183fbc116c406ca86889a9fb3e2de61520b60 (patch)
treeab979ebabffad7f63f23666aa80025d9bad90872 /src/client/views/collections/CollectionVideoView.tsx
parent39bb878a32821d2e14110f4158471890234f4769 (diff)
parent3da71792a339536118b7af7cfe0529201a45c64e (diff)
merge
Diffstat (limited to 'src/client/views/collections/CollectionVideoView.tsx')
-rw-r--r--src/client/views/collections/CollectionVideoView.tsx10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/client/views/collections/CollectionVideoView.tsx b/src/client/views/collections/CollectionVideoView.tsx
index 29fb342c6..779dc8fc3 100644
--- a/src/client/views/collections/CollectionVideoView.tsx
+++ b/src/client/views/collections/CollectionVideoView.tsx
@@ -37,10 +37,13 @@ export class CollectionVideoView extends React.Component<FieldViewProps> {
]);
}
+ _ele: HTMLDivElement | null = null;
@action
mainCont = (ele: HTMLDivElement | null) => {
+ this._ele = ele;
if (ele) {
this._player = ele.getElementsByTagName("video")[0];
+ console.log(this._player);
if (this.props.Document.GetNumber(KeyStore.CurPage, -1) >= 0) {
this._currentTimecode = this.props.Document.GetNumber(KeyStore.CurPage, -1);
}
@@ -57,9 +60,12 @@ export class CollectionVideoView extends React.Component<FieldViewProps> {
@action
updateTimecode = () => {
+ this._player = this._player ? this._player : this._ele ? this._ele.getElementsByTagName("video")[0] : undefined;
if (this._player) {
- if ((this._player as any).AHackBecauseSomethingResetsTheVideoToZero !== -1) {
- this._player.currentTime = (this._player as any).AHackBecauseSomethingResetsTheVideoToZero;
+ let timecode = (this._player as any).hasOwnProperty("AHackBecauseSomethingResetsTheVideoToZero") ?
+ (this._player as any).AHackBecauseSomethingResetsTheVideoToZero : -1;
+ if (timecode !== -1 && Object) {
+ this._player.currentTime = timecode;
(this._player as any).AHackBecauseSomethingResetsTheVideoToZero = -1;
} else {
this._currentTimecode = this._player.currentTime;