aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.github/pull_request_template.md10
-rw-r--r--.travis.yml7
-rw-r--r--gulpfile.js7
-rw-r--r--package.json2
-rw-r--r--src/js/html5.js10
5 files changed, 27 insertions, 9 deletions
diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md
index c4779d3c..670d8a5b 100644
--- a/.github/pull_request_template.md
+++ b/.github/pull_request_template.md
@@ -1,8 +1,8 @@
### Link to related issue (if applicable)
-### Sumary of proposed changes
+### Summary of proposed changes
-### Task list
-
-- [ ] Tested on [supported browsers](https://github.com/sampotts/plyr#browser-support)
-- [ ] Gulp build completed \ No newline at end of file
+### Checklist
+- [ ] Use `develop` as the base branch
+- [ ] Exclude the gulp build from the PR
+- [ ] Test on [supported browsers](https://github.com/sampotts/plyr#browser-support)
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 00000000..d2722414
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,7 @@
+language: node_js
+node_js:
+ - 'lts/*'
+
+script:
+ - npm run lint
+ - npm run build
diff --git a/gulpfile.js b/gulpfile.js
index 9a6da95f..28909e27 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -226,9 +226,14 @@ gulp.task('watch', () => {
gulp.watch(paths.demo.src.sass, tasks.sass);
});
+// Build distribution
+gulp.task('build', () => {
+ run(tasks.clean, tasks.js, tasks.sass, tasks.sprite);
+});
+
// Default gulp task
gulp.task('default', () => {
- run(tasks.clean, tasks.js, tasks.sass, tasks.sprite, 'watch');
+ run('build', 'watch');
});
// Publish a version to CDN and demo
diff --git a/package.json b/package.json
index 950af4f6..db086d03 100644
--- a/package.json
+++ b/package.json
@@ -65,6 +65,8 @@
"doc": "readme.md"
},
"scripts": {
+ "build": "gulp build",
+ "lint": "eslint src/js",
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Sam Potts <sam@potts.es>",
diff --git a/src/js/html5.js b/src/js/html5.js
index 3818a441..63596cfc 100644
--- a/src/js/html5.js
+++ b/src/js/html5.js
@@ -99,6 +99,13 @@ const html5 = {
// Set new source
player.media.src = supported[0].getAttribute('src');
+ // Restore time
+ const onLoadedMetaData = () => {
+ player.currentTime = currentTime;
+ player.off('loadedmetadata', onLoadedMetaData);
+ };
+ player.on('loadedmetadata', onLoadedMetaData);
+
// Load new source
player.media.load();
@@ -107,9 +114,6 @@ const html5 = {
player.play();
}
- // Restore time
- player.currentTime = currentTime;
-
// Trigger change event
utils.dispatchEvent.call(player, player.media, 'qualitychange', false, {
quality: input,