Skip to content

Commit

Permalink
Merge branch 'release/0.3.8'
Browse files Browse the repository at this point in the history
  • Loading branch information
towerz committed Aug 14, 2019
2 parents 648c577 + 7321189 commit 8a10c79
Show file tree
Hide file tree
Showing 10 changed files with 33 additions and 8 deletions.
2 changes: 1 addition & 1 deletion bower.json
@@ -1,7 +1,7 @@
{
"name": "clappr",
"description": "An extensible media player for the web",
"version": "0.3.7",
"version": "0.3.8",
"homepage": "https://github.com/clappr/clappr",
"authors": [
"Globo.com"
Expand Down
7 changes: 6 additions & 1 deletion dist/clappr.js
Expand Up @@ -30386,7 +30386,7 @@ var _clapprZepto2 = _interopRequireDefault(_clapprZepto);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var version = "0.3.7"; // Copyright 2014 Globo.com Player authors. All rights reserved.
var version = "0.3.8"; // Copyright 2014 Globo.com Player authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

Expand Down Expand Up @@ -33077,6 +33077,11 @@ var HTML5Video = function (_Playback) {
return _this;
}

HTML5Video.prototype.configure = function configure(options) {
_Playback.prototype.configure.call(this, options);
this.el.loop = !!options.loop;
};

// See Playback.attemptAutoPlay()


Expand Down
2 changes: 1 addition & 1 deletion dist/clappr.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/clappr.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/clappr.plainhtml5.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/clappr.plainhtml5.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/clappr.plainhtml5.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "clappr",
"version": "0.3.7",
"version": "0.3.8",
"description": "An extensible media player for the web",
"main": "./dist/clappr.js",
"scripts": {
Expand Down
5 changes: 5 additions & 0 deletions src/playbacks/html5_video/html5_video.js
Expand Up @@ -144,6 +144,11 @@ export default class HTML5Video extends Playback {
this.options.autoPlay && this.attemptAutoPlay()
}

configure(options) {
super.configure(options)
this.el.loop = !!options.loop
}

// See Playback.attemptAutoPlay()
attemptAutoPlay() {
this.canAutoPlay((result, error) => {
Expand Down
15 changes: 15 additions & 0 deletions test/playbacks/html5_video_spec.js
Expand Up @@ -383,4 +383,19 @@ describe('HTML5Video playback', function() {
expect(playback.tagName).to.be.equal('video')
})
})

it('can configure loop', function() {
const options = $.extend({ loop: true }, this.options)
const playback = new HTML5Video(options)

expect(playback.el.loop).to.be.equal(true)

playback.configure({ loop: false })

expect(playback.el.loop).to.be.equal(false)

playback.configure({ loop: true })

expect(playback.el.loop).to.be.equal(true)
})
})

0 comments on commit 8a10c79

Please sign in to comment.