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

Add playback speed button to video player #4917

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
@@ -1,5 +1,5 @@
<div id="video-player"{{#unless content_urls }} class="client-online-only"{{/unless}}>
<video class="video-player video-js vjs-default-skin vjs-fullscreen" id="{{ random_id }}" controls preload="auto" width="auto" height="auto" {{#if content_urls.thumbnail }}poster="{{ content_urls.thumbnail }}" {{/if}}data-setup="{}">
<video class="video-player video-js vjs-default-skin vjs-fullscreen" id="{{ random_id }}">

This comment was marked as spam.

This comment was marked as spam.

<source src="{{ content_urls.stream }}" type="{{ content_urls.stream_type }}" />
{{#each subtitle_urls }}
<track kind="captions" src="{{ this.url }}" srclang="{{ code }}" label="{{ name }}" {{#ifcond code "==" ../selected_language }}{{#ifcond ../code "!=" "en" }}default="True"{{/ifcond}}{{/ifcond}}/>
Expand Down
11 changes: 10 additions & 1 deletion kalite/distributed/static/js/distributed/video/views.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,16 @@ var VideoPlayerView = ContentBaseView.extend({
var player_id = this.$(".video-js").attr("id");

if (player_id) {
this.player = this.player = _V_(player_id);
var video_player_options = {
"controls": true,
"width": "auto",
"height": "auto",
"playbackRates": [0.5, 1, 1.25, 1.5, 2]
};
if( this.data_model.get("content_urls").thumbnail ) {
video_player_options['poster'] = this.data_model.get("content_urls").thumbnail;
}
this.player = window.player = _V_(player_id, video_player_options);
this.initialize_listeners();
} else {
console.warn("Warning: Could not find Video.JS player!");
Expand Down