diff options
author | bobzel <zzzman@gmail.com> | 2021-03-23 16:20:50 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2021-03-23 16:20:50 -0400 |
commit | ccdef5784dd963b71f493116d87786c0b0a787d2 (patch) | |
tree | 2e39ef677f119a3ca73633ba39e7c667c128633e /src | |
parent | 4b699bd0ded39983227d11e75c8d187546190f00 (diff) |
from last
Diffstat (limited to 'src')
-rw-r--r-- | src/client/views/nodes/formattedText/FormattedTextBox.tsx | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/client/views/nodes/formattedText/FormattedTextBox.tsx b/src/client/views/nodes/formattedText/FormattedTextBox.tsx index 47fad9112..5ea24d185 100644 --- a/src/client/views/nodes/formattedText/FormattedTextBox.tsx +++ b/src/client/views/nodes/formattedText/FormattedTextBox.tsx @@ -1129,18 +1129,17 @@ export class FormattedTextBox extends ViewBoxAnnotatableComponent<(FieldViewProp if ((e.target as any).tagName === "AUDIOTAG") { e.preventDefault(); e.stopPropagation(); - const time = (e.target as any)?.dataset?.timecode || 0; - const audioid = (e.target as any)?.dataset?.audioid || 0; - DocServer.GetRefField(audioid).then(anchor => { + DocServer.GetRefField((e.target as any)?.dataset?.audioid || 0).then(anchor => { if (anchor instanceof Doc) { + const timecode = NumCast(anchor.timecodeToShow, 0); const audiodoc = anchor.annotationOn as Doc; const func = () => { const docView = DocumentManager.Instance.getDocumentView(audiodoc); if (!docView) { this.props.addDocTab(audiodoc, "add:bottom"); - setTimeout(() => func()); + setTimeout(func); } - else docView.ComponentView?.playFrom?.(Number(time), Number(time) + 3); // bcz: would be nice to find the next audio tag in the doc and play until that + else docView.ComponentView?.playFrom?.(timecode, Cast(anchor.timecodeToHide, "number", null)); // bcz: would be nice to find the next audio tag in the doc and play until that } func(); } |