-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from gabor-boros/gabor/add-srt-download
[SE-4161] Add Download Transcripts button
- Loading branch information
Showing
12 changed files
with
246 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,11 @@ | ||
language: python | ||
python: | ||
- "3.5" | ||
- "3.6" | ||
|
||
script: nosetests | ||
env: | ||
- PYTHONPATH=`pwd` | ||
|
||
install: | ||
- pip install -r requirements-test.txt | ||
|
||
script: DJANGO_SETTINGS_MODULE=test_settings pytest wistiavideo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
-r requirements.txt | ||
|
||
django-pyfs==3.0 | ||
mock==4.0.3 | ||
pytest-django==4.1.0 | ||
pytest==6.2.2 | ||
xblock-sdk==0.2.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ XBlock~=1.3.1 | |
xblock-utils~=2.1.1 | ||
django==2.2.15 | ||
mako==1.0.2 | ||
requests==2.25.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
from workbench.settings import * | ||
from django.conf.global_settings import LOGGING | ||
|
||
DEBUG = True | ||
|
||
INSTALLED_APPS += ('wistiavideo', ) | ||
SECRET_KEY = '4l0ngs3cr3tstr1ngw3lln0ts0l0ngw41tn0w1tsl0ng3n0ugh' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,24 @@ | ||
/* CSS for WistiaVideoXBlock */ | ||
|
||
.wistiavideo_block .wistia_responsive_transcripts { | ||
margin: 1rem 0; | ||
} | ||
|
||
.wistiavideo_block .wistia_responsive_transcripts .wistia_transcripts_download { | ||
background: rgba(30, 123, 237, 0.9); | ||
border-radius: 0.1875rem; | ||
padding: 11px 18px 11px 16px; | ||
} | ||
|
||
.wistiavideo_block .wistia_responsive_transcripts .wistia_transcripts_download, | ||
.wistiavideo_block .wistia_responsive_transcripts .wistia_transcripts_download:hover, | ||
.wistiavideo_block .wistia_responsive_transcripts .wistia_transcripts_download:active, | ||
.wistiavideo_block .wistia_responsive_transcripts .wistia_transcripts_download:visited { | ||
color: white; | ||
} | ||
|
||
.wistiavideo_block .wistia_responsive_transcripts .wistia_transcripts_download:hover, | ||
.wistiavideo_block .wistia_responsive_transcripts .wistia_transcripts_download:active, | ||
.wistiavideo_block .wistia_responsive_transcripts .wistia_transcripts_download:visited { | ||
background: rgba(30, 123, 237, 1); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
<div class="wistiavideo_block"> | ||
<script src="//fast.wistia.com/embed/medias/{self.media_id}.jsonp" async></script> | ||
<script src="//fast.wistia.com/embed/medias/{{ media_id }}.jsonp" async></script> | ||
<script src="//fast.wistia.com/assets/external/E-v1.js" async></script> | ||
<div class="wistia_responsive_padding" style="padding:56.25% 0 0 0;position:relative;"> | ||
<div class="wistia_responsive_wrapper" style="height:100%;left:0;position:absolute;top:0;width:100%;"> | ||
<div class="wistia_embed wistia_async_{self.media_id} videoFoam=true" style="height:100%;width:100%"> </div> | ||
<div id="wistia_{{ media_id }}" data-media-id="{{ media_id }}" class="wistia_embed wistia_async_{{ media_id }} videoFoam=true" style="height:100%;width:100%"> </div> | ||
</div> | ||
</div> | ||
<p class="wistia_responsive_transcripts"> | ||
<a href="#" style="display: none;" class="wistia_transcripts_download">{{ download_transcripts_text }}</a> | ||
</p> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
function WistiaVideoXBlock(runtime, element) { | ||
"use strict"; | ||
|
||
const downloadHandlerUrl = runtime.handlerUrl(element, 'download_captions'); | ||
const downloadBtnSelector = '.wistiavideo_block .wistia_responsive_transcripts .wistia_transcripts_download'; | ||
const wistiaEmbeddedSelector = ".wistiavideo_block .wistia_responsive_padding .wistia_responsive_wrapper .wistia_embed"; | ||
const mediaId = $(wistiaEmbeddedSelector).data("mediaId"); | ||
|
||
$(downloadBtnSelector, element).click(function (e) { | ||
e.preventDefault(); | ||
window.open(downloadHandlerUrl, '_blank'); | ||
}); | ||
|
||
window._wq = window._wq || []; | ||
|
||
_wq.push({ id: mediaId, onReady: function(video) { | ||
video.plugin('captions').then(function (captions) { | ||
if (captions.captions.length > 0) { | ||
$(downloadBtnSelector).show(); | ||
} | ||
}); | ||
}}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters