diff options
Diffstat (limited to 'animism-align/frontend/app/views/viewer/player')
6 files changed, 24 insertions, 25 deletions
diff --git a/animism-align/frontend/app/views/viewer/player/components.fullscreen/fullscreen.video.js b/animism-align/frontend/app/views/viewer/player/components.fullscreen/fullscreen.video.js index 252a278..da1e0ed 100644 --- a/animism-align/frontend/app/views/viewer/player/components.fullscreen/fullscreen.video.js +++ b/animism-align/frontend/app/views/viewer/player/components.fullscreen/fullscreen.video.js @@ -34,11 +34,11 @@ class FullscreenVideo extends Component { this.handleEnd = this.handleEnd.bind(this) } componentDidMount() { - const { video_start_ts } = this.props.element.settings - const seconds = timestampToSeconds(video_start_ts) || 0.0 + const video_start_ts = timestampToSeconds(this.props.element.settings.video_start_ts) || 0.0 + // TODO: here you can add the current play time modulo ... this.setState({ - video_start_ts: seconds, - seek: seconds, + seek: video_start_ts, + video_start_ts, }) } componentDidUpdate(prevProps) { diff --git a/animism-align/frontend/app/views/viewer/player/components.inline/inline.text.js b/animism-align/frontend/app/views/viewer/player/components.inline/inline.text.js index 2475801..b2633a4 100644 --- a/animism-align/frontend/app/views/viewer/player/components.inline/inline.text.js +++ b/animism-align/frontend/app/views/viewer/player/components.inline/inline.text.js @@ -61,17 +61,18 @@ export const Pullquote = ({ paragraph, currentParagraph, currentAnnotation, onAn /> ) } + const isPullquoteCredit = annotation.type === 'pullquote_credit' return ( <span key={annotation.id} className={ - annotation.type === 'pullquote_credit' + isPullquoteCredit ? 'pullquote_credit' : annotation.id === currentAnnotation ? 'current' : '' } - onClick={e => onAnnotationClick(e, paragraph, annotation)} + onClick={e => !isPullquoteCredit && onAnnotationClick(e, paragraph, annotation)} dangerouslySetInnerHTML={{ __html: ' ' + annotation.text + ' ' }} /> ) diff --git a/animism-align/frontend/app/views/viewer/player/components.inline/inline.video.js b/animism-align/frontend/app/views/viewer/player/components.inline/inline.video.js index d6de779..9a0ff7a 100644 --- a/animism-align/frontend/app/views/viewer/player/components.inline/inline.video.js +++ b/animism-align/frontend/app/views/viewer/player/components.inline/inline.video.js @@ -70,6 +70,7 @@ export class MediaVideo extends Component { ) } + // otherwise, inline the vimeo player const poster = annotation.settings.poster ? { backgroundImage: 'url(' + posterURL(item) + ')', } : {} diff --git a/animism-align/frontend/app/views/viewer/player/components.media/video.scrubber.js b/animism-align/frontend/app/views/viewer/player/components.media/video.scrubber.js index f866628..e1b22a7 100644 --- a/animism-align/frontend/app/views/viewer/player/components.media/video.scrubber.js +++ b/animism-align/frontend/app/views/viewer/player/components.media/video.scrubber.js @@ -73,6 +73,9 @@ class VideoScrubber extends Component { } handleMouseMove(e) { e.stopPropagation() + if (e.pageY < window.innerHeight / 2) { + return + } // console.log('move', this.defer) if (this.defer) { this.defer = false diff --git a/animism-align/frontend/app/views/viewer/player/components.media/video.subtitles.js b/animism-align/frontend/app/views/viewer/player/components.media/video.subtitles.js index dfa7a85..f056168 100644 --- a/animism-align/frontend/app/views/viewer/player/components.media/video.subtitles.js +++ b/animism-align/frontend/app/views/viewer/player/components.media/video.subtitles.js @@ -3,8 +3,7 @@ import { connect } from 'react-redux' import actions from 'app/actions' import { timestampToSeconds, floatInRange } from 'app/utils' - -const REGEXP_ALL_COMMAS = new RegExp(',', 'g') +import { parseSubtitles } from 'app/utils/transcript.utils' export default class VideoSubtitles extends Component { state = { @@ -20,23 +19,10 @@ export default class VideoSubtitles extends Component { } } loadSubtitles() { - if (!this.props.mediaItem || !this.props.mediaItem.settings.subtitles) return; - const groups = this.props.mediaItem.settings.subtitles.split("\n\n") - const subtitles = groups.map((group) => { - if (!group) return - const lines = group.trim().split("\n") - if (!lines.length || !parseInt(lines[0])) { - return null - } - let ts_parts = lines[1].replace(REGEXP_ALL_COMMAS, '.').split(" --> ").map(timestampToSeconds) - return { - id: parseInt(lines[0]), - start_ts: ts_parts[0], - end_ts: ts_parts[1], - lines: lines.slice(2), - } - }).filter(a => !!a) - this.setState({ subtitles, current: null }) + const subtitles = parseSubtitles(this.props.mediaItem, 0) + if (subtitles) { + this.setState({ subtitles, current: null }) + } } updateCurrentSubtitle() { const { play_ts } = this.props diff --git a/animism-align/frontend/app/views/viewer/player/player.transcript.css b/animism-align/frontend/app/views/viewer/player/player.transcript.css index 5c7056b..dcdcabb 100644 --- a/animism-align/frontend/app/views/viewer/player/player.transcript.css +++ b/animism-align/frontend/app/views/viewer/player/player.transcript.css @@ -157,6 +157,14 @@ cursor: pointer; transition: all 0.1s; } +.player-transcript .pullquote span.pullquote_credit, +.player-transcript .pullquote span.pullquote_credit.current, +.player-transcript .pullquote span.pullquote_credit.current:hover { + box-shadow: 0 0 0 rgba(255,255,255,0.0); + background: transparent; + color: inherit; + cursor: default; +} .player-transcript .paragraph { position: relative; |
