Skip to content

Commit

Permalink
Merge pull request #108 from raccoongang/dev
Browse files Browse the repository at this point in the history
- Default transcripts. Allow to fetch transcripts from the video platform and store them into XBlock.
- Brightcove auto-quality and content encryption.
- Various bugfixes and improvements
  • Loading branch information
z4y4ts authored Feb 7, 2017
2 parents 8644870 + 66d0a1a commit 99e7c55
Show file tree
Hide file tree
Showing 47 changed files with 3,789 additions and 861 deletions.
8 changes: 8 additions & 0 deletions .bowerrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"directory": "video_xblock/static/bower_components",
"scripts": {
"preinstall": "",
"postinstall": "",
"preuninstall": ""
}
}
26 changes: 26 additions & 0 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Serves for configuration of CodeClimate (automated code review for test coverage, complexity, duplication, etc.)
engines:
csslint:
enabled: true
duplication:
enabled: true
config:
languages:
- javascript
- python
exclude_fingerprints:
- ffaa02171edd2e7b1184b6eacdbed97f
eslint:
# Disabled since CodeClimate doesn't yet support eslint-config-edx plugin
enabled: false
channel: "eslint-3"
fixme:
enabled: true
radon:
enabled: true
ratings:
paths:
- "**.css"
- "**.js"
- "**.py"
exclude_paths: []
1 change: 1 addition & 0 deletions .coveralls.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
repo_token: St0myP2WKubt2SrFuyQDZI7Y1gsxDIiiX
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@ trim_trailing_whitespace = true

[*.yml]
indent_size = 2

[Makefile]
indent_style = tab
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
video_xblock/static/js/player_state.js
22 changes: 22 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"extends": "eslint-config-edx",
"globals": {
"videojs": true,
"domReady": true
},
"rules": {
"no-underscore-dangle": [
"error", {"allow": [
// VideoJS components' attributes
"childNameIndex_", "el_", "kind_", "labelEl_", "options_", "player_", "tracks_"
]}
],
"require-jsdoc": ["error", {
"require": {
"FunctionDeclaration": true,
"MethodDefinition": true,
"ClassDeclaration": true
}
}]
}
}
27 changes: 25 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,29 @@
language: python
python:
- "2.7"
- "2.7.10"
- "2.7.13"

cache:
pip: true
directories:
- node_modules # NPM packages

before_install:
# Install latest stable NodeJS version. Required for eslint.
- nvm install stable
# Install binary package for lxml to speed up build
- sudo apt-get -qq update
- sudo apt-get install -y python-lxml

before_script:
- make deps-test
# Install eslint, eslint-config-edx and their dependencies
- make tools

script:
- "pylint video_xblock"
- make quality-py
- make quality-js
- make test-py

after_success:
- coveralls
33 changes: 33 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
.PHONY=all,quality,test

all: quality test

clean:
-rm -rf node_modules/

test: test-py

test-py:
nosetests video_xblock --with-coverage --cover-package=video_xblock

quality: quality-py quality-js

quality-py:
pep8 . --format=pylint --max-line-length=120
pylint -f colorized video_xblock

quality-js:
eslint video_xblock/static/js/

deps:
pip install -r requirements.txt
bower install

deps-test:
pip install -r test_requirements.txt

tools:
npm install "eslint@^2.12.0" eslint-config-edx "eslint-plugin-dollar-sign@0.0.5" "eslint-plugin-import@^1.9.2"

package:
echo "Here be static dependencies packaging"
29 changes: 25 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,25 @@
[![Build Status](https://travis-ci.org/raccoongang/xblock-video.svg?branch=dev)](https://travis-ci.org/raccoongang/xblock-video)
[![Coverage Status](https://coveralls.io/repos/github/raccoongang/xblock-video/badge.svg?branch=dev)](https://coveralls.io/github/raccoongang/xblock-video?branch=dev)

# xblock-video

XBlock to embed videos hosted on different video platform into your courses.

## Installation

```bash
```shell
sudo -sHu edxapp
source ~/edxapp_env
# Clone and install xblock
git clone https://github.com/raccoongang/xblock-video.git
cd xblock-video
pip install -e .
# Install external JavaScript dependencies
cd video_xblock/static
bower install
# Install Python and JavaScript dependencies
make deps
```

## Enabling in Studio

You can enable the Wistia xblock in studio through the advanced
settings:

Expand All @@ -31,6 +35,23 @@ settings:

TODO

## Development

Install dependencies and development tools:
```shell
> make deps deps-test tools
```

Run quality checks:
```shell
> make quality
```

Run tests:
```shell
> make test
```

## License

The code in this repository is licensed under the GPL v3 licence unless otherwise noted.
Expand Down
5 changes: 3 additions & 2 deletions video_xblock/static/bower.json → bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@
"videojs-youtube": "raccoongang/videojs-youtube#playback-rate-fix",
"videojs-wistia": "raccoongang/videojs-wistia#playback-toggle-fix",
"videojs-transcript": "0.8.0",
"videojs-resolution-switcher": "85f1e51c8babefca2d670dbd0b21a6307dbb4d21",
"videojs-resolution-switcher": "videojs-resolution-switcher#85f1e51",
"videojs-offset": "raccoongang/videojs-offset#master",
"videojs-contextmenu": "brightcove/videojs-contextmenu",
"videojs-contextmenu-ui": "brightcove/videojs-contextmenu-ui"
"videojs-contextmenu-ui": "brightcove/videojs-contextmenu-ui",
"videojs-vimeo": "raccoongang/videojs-vimeo#bug/clean-player-code"
},
"private": true
}
8 changes: 3 additions & 5 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
git+https://github.com/edx/XBlock.git#egg=XBlock==0.4.12
git+https://github.com/edx/xblock-utils.git#egg=xblock-utils==1.0.2
django==1.8.12
edx-lint==0.5.1
git+https://github.com/edx/XBlock.git@xblock-0.4.12#egg=XBlock==0.4.12
git+https://github.com/edx/xblock-utils.git@v1.0.2#egg=xblock-utils==1.0.2
pycaption<1.0 # The latest Python 2.7 compatible version
pylint==1.4.5
requests==2.9.1
babelfish==0.5.5
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ def package_data(pkg, roots):
'wistia-player = video_xblock.backends.wistia:WistiaPlayer',
'brightcove-player = video_xblock.backends.brightcove:BrightcovePlayer',
'dummy-player = video_xblock.backends.dummy:DummyPlayer',
'vimeo-player = video_xblock.backends.vimeo:VimeoPlayer'
]
},
package_data=package_data("video_xblock", ["static",]),
package_data=package_data("video_xblock", ["static", ]),
)
12 changes: 12 additions & 0 deletions test_requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Auto-transcripts upload is dependent on xmodule.contentstore
git+https://github.com/edx/edx-platform.git@open-release/eucalyptus.3#egg=xmodule==0.1.1&subdirectory=common/lib/xmodule/
PyContracts==1.7.1 # xmodule dependency
sortedcontainers==0.9.2 # xmodule dependency
Pillow==3.1.1 # xmodule dependency

coveralls==1.1
django==1.8.12
edx-lint==0.5.2
mako==1.0.2
pylint==1.6.5
pep8
Loading

0 comments on commit 99e7c55

Please sign in to comment.