Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interactive video transcript #5631

Merged
merged 61 commits into from
Nov 12, 2019
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
da4bd01
Remove yarn.lock file no longer needed
bjester Apr 17, 2019
43c178f
Merge branch 'develop' into interactive-video-transcript
bjester Apr 22, 2019
51d7ae0
Merge branch 'develop' into interactive-video-transcript
bjester Apr 25, 2019
b1e8aa2
Refactor creating pattern for breaking out more functionality
bjester Apr 26, 2019
272e2ea
Merge branch 'develop' into interactive-video-transcript
bjester May 1, 2019
11b6d95
Track handling and cue display
bjester May 3, 2019
d47df83
Merge branch 'develop' into interactive-video-transcript
bjester May 3, 2019
10745be
Fix css import
bjester May 3, 2019
14350e0
Merge branch 'develop' into interactive-video-transcript
bjester May 13, 2019
79deece
Add scrolling and responsive positioning of transcript
bjester May 15, 2019
3558b6a
Responsive positioning of transcript
bjester May 15, 2019
3256ee5
Prevent event loop from setting mode consequences
bjester May 15, 2019
b12e83c
Labeling and orientation updates
bjester May 15, 2019
d885cdf
Styling for older browsers
bjester May 15, 2019
381d551
Merge branch 'develop' into interactive-video-transcript
bjester Jun 6, 2019
ef71d09
Fix theme references
bjester Jun 6, 2019
2800ad1
Merge branch 'develop' into interactive-video-transcript
bjester Jun 18, 2019
1143ca5
Styling updates
bjester Jun 18, 2019
47fb09d
Handle edge case where cue(s) could be larger than viewable area
bjester Jun 18, 2019
bba1351
WIP updates to transcript control
bjester Jul 9, 2019
cb64e02
Show active language in menu
bjester Jul 9, 2019
cfcbd61
Refactor state management, use vuex
bjester Jul 10, 2019
d2b4c2f
Remove track additions
bjester Jul 10, 2019
36126ef
Be defensive against no enabled track
bjester Jul 10, 2019
6c42490
Add resetState actions for cleanUP
bjester Jul 10, 2019
fffb2b6
Cleanup unused code
bjester Jul 10, 2019
3a9d2c7
Merge branch 'develop' into interactive-video-transcript
bjester Jul 10, 2019
7770bd3
Add more contrast to active cues
bjester Jul 10, 2019
29d0f68
Add more hover contrast to cues
bjester Jul 10, 2019
ca87058
Fix merge conflicts
bjester Oct 23, 2019
34d63d6
Post develop merge fixes
bjester Oct 23, 2019
d0e33b3
Code review update
bjester Oct 23, 2019
77d7154
Remove empty data
bjester Oct 23, 2019
fcf469f
Remove whitespace
bjester Oct 23, 2019
9e440a9
Remove whitespace
bjester Oct 23, 2019
d867cd0
Remove transitions and z-indices
bjester Oct 23, 2019
de307b3
Remove whitespace
bjester Oct 23, 2019
96d5147
Loading state tweaks
bjester Oct 23, 2019
035a015
Remove line readded in merge resolution
bjester Oct 23, 2019
4f1fffc
Use 100% and watch for fullscreen to better trigger resize
bjester Oct 23, 2019
7329306
Split caption and language menus into separate popups
bjester Oct 25, 2019
fb68d18
Merge branch 'develop' into interactive-video-transcript
bjester Oct 25, 2019
6487562
Style fixes
bjester Oct 25, 2019
432320a
Avoid cue overlap on transcript select
bjester Oct 25, 2019
0735d19
Fix merge conflicts
bjester Oct 30, 2019
8699188
Keyboard navigation of custom menus through video.js
bjester Nov 6, 2019
c6479d4
Enable subtitles when selecting a language without format enabled
bjester Nov 6, 2019
f83afaf
Fix disabling menu without text tracks
bjester Nov 6, 2019
9a90e94
Trigger seek on spacebar
bjester Nov 6, 2019
6231666
Subtitles are enabled by default
bjester Nov 6, 2019
6408e78
Self review updates
bjester Nov 6, 2019
63a95c8
Simplify vuex state, add half-fix for Safari loading issue
bjester Nov 7, 2019
ba95106
Fix IE unfriendly scrolling
bjester Nov 7, 2019
4addf6e
Override video.js touch handling interfering with mobile ux
bjester Nov 7, 2019
2a7a80c
Add gherkin story
bjester Nov 7, 2019
4ceef1a
Add Home and End key handling
bjester Nov 8, 2019
84330f6
Always show control bar when navigating by keyboard
bjester Nov 8, 2019
afbf81f
Merge branch 'develop' into interactive-video-transcript
bjester Nov 8, 2019
eaa4438
Fix subtitle strings for download button
bjester Nov 8, 2019
fe5b3c8
Better language handling when navigating between videos with differen…
bjester Nov 8, 2019
0043121
Change event to loadedmetadata
bjester Nov 8, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
:class="[
'wrapper',
{
'keyboard-modality': $inputModality === 'keyboard',
'video-loading': loading,
'transcript-visible': transcriptVisible,
'transcript-wrap': windowIsPortrait || (!isFullscreen && windowIsSmall),
Expand Down Expand Up @@ -587,9 +588,13 @@
}

/* Hide control bar when playing & inactive */
/deep/ .vjs-has-started.vjs-playing.vjs-user-inactive {
.vjs-control-bar {
visibility: hidden;
/deep/ .vjs-has-started.vjs-playing.vjs-user-inactive .vjs-control-bar {
visibility: hidden;

/* Always show control bar in keyboard modality */
.keyboard-modality & {
visibility: visible;
opacity: 1;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
@click="triggerSeekEvent"
@keypress.enter="triggerSeekEvent"
@keypress.space="triggerSeekEvent"
@keydown.home.prevent="$emit('goTo', 'beginning')"
@keydown.end.prevent="$emit('goTo', 'end')"
>
<span
class="transcript-cue-time"
Expand Down Expand Up @@ -117,6 +119,12 @@
offsetTop() {
return this.$el.offsetTop;
},
/**
* @public
*/
focus() {
return this.$el.focus();
},
},
$trs: {
title: 'Seek to {startTime}',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
:active="activeCueIds.indexOf(cue.id) >= 0"
:mediaDuration="mediaDuration"
@seek="handleSeekEvent"
@goTo="handleGoTo"
/>
</template>
<div
Expand Down Expand Up @@ -118,6 +119,28 @@
// Add 10ms to cueTime to avoid triggering two cues if they overlap on end and start time
this.player.currentTime(cueTime + 0.01);
},
/**
* @param {String} place `beginning` or `end`
*/
handleGoTo(place) {
if (!this.cues.length || !Object.keys(this.$refs).length) {
return;
}

const cueId = place === 'beginning' ? this.cues[0].id : this.cues[this.cues.length - 1].id;
const cue = this.getCue(cueId);

if (cue) {
cue.focus();
}
},
getCue(cueId) {
if (!(cueId in this.$refs) || !this.$refs[cueId]) {
return null;
}

return this.$refs[cueId][0];
},
scrollTo(offsetTop, offsetBottom, duration) {
const start = new Date().getTime();

Expand Down Expand Up @@ -178,12 +201,11 @@
*/
cueReduce(callback) {
return (reduced, cueId) => {
if (!(cueId in this.$refs) || !this.$refs[cueId]) {
const cue = this.getCue(cueId);
if (!cue) {
return reduced;
}

const [cue] = this.$refs[cueId];

try {
return callback(reduced, cue);
} catch (e) {
Expand Down
3 changes: 3 additions & 0 deletions packages/kolibri-components/src/KThemePlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ export default function KThemePlugin(Vue) {
outline: 'none',
};
},
$inputModality() {
return globalThemeState.inputModality;
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had tried to add it as a computed prop solely to the media player component, but it wouldn't update. Although, this works even though it's nearly the same.

},
/* eslint-enable kolibri/vue-no-unused-properties */
});
Expand Down