Comparar commits
11 Commits
| Autor | SHA1 | Data | |
|---|---|---|---|
| ec5b60329f | |||
| 0287f6e076 | |||
| e8511a5799 | |||
| 69577790eb | |||
| b1de506b43 | |||
| 6738f765da | |||
| 8ec61bbb20 | |||
| 85a34d1b49 | |||
| 4658c7bad6 | |||
| 8878acc040 | |||
| 20f7fe991f |
@@ -1,3 +1,32 @@
|
||||
<a name="6.3.3"></a>
|
||||
## [6.3.3](https://github.com/videojs/video.js/compare/v6.3.2...v6.3.3) (2017-10-10)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* a possible breaking change caused by the use of remainingTimeDisplay ([#4655](https://github.com/videojs/video.js/issues/4655)) ([b1de506](https://github.com/videojs/video.js/commit/b1de506))
|
||||
|
||||
### Documentation
|
||||
|
||||
* **hooks:** Fix Typo ([#4652](https://github.com/videojs/video.js/issues/4652)) ([6738f76](https://github.com/videojs/video.js/commit/6738f76))
|
||||
|
||||
<a name="6.3.2"></a>
|
||||
## [6.3.2](https://github.com/videojs/video.js/compare/v6.3.1...v6.3.2) (2017-10-04)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Fix a typo in current time display component. ([#4647](https://github.com/videojs/video.js/issues/4647)) ([4658c7b](https://github.com/videojs/video.js/commit/4658c7b))
|
||||
|
||||
### Documentation
|
||||
|
||||
* Document how to add a version number to a plugin ([#4642](https://github.com/videojs/video.js/issues/4642)) ([85a34d1](https://github.com/videojs/video.js/commit/85a34d1))
|
||||
|
||||
<a name="6.3.1"></a>
|
||||
## [6.3.1](https://github.com/videojs/video.js/compare/v6.3.0...v6.3.1) (2017-10-03)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Make sure time displays use correctly-formatted time. ([#4643](https://github.com/videojs/video.js/issues/4643)) ([20f7fe9](https://github.com/videojs/video.js/commit/20f7fe9))
|
||||
|
||||
<a name="6.3.0"></a>
|
||||
# [6.3.0](https://github.com/videojs/video.js/compare/v6.2.8...v6.3.0) (2017-10-03)
|
||||
|
||||
|
||||
@@ -35,10 +35,10 @@ if (args.prerelease || npmargs.some(function(arg) { return /next/.test(arg); }))
|
||||
|
||||
ghrelease(options, function(err, result) {
|
||||
if (err) {
|
||||
console.log('Unable to publish release to github');
|
||||
console.log(err);
|
||||
console.error('Unable to publish release to github');
|
||||
console.error('err:', err);
|
||||
console.error('result:', result);
|
||||
} else {
|
||||
console.log('Publish release to github!');
|
||||
console.log(result);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -14,7 +14,7 @@ Hooks exist so that users can "hook" on to certain Video.js player lifecycle
|
||||
|
||||
## Current Hooks
|
||||
|
||||
Currently, the following hooks are avialable:
|
||||
Currently, the following hooks are available:
|
||||
|
||||
### beforesetup
|
||||
|
||||
|
||||
@@ -225,6 +225,25 @@ The `dispose` method has several effects:
|
||||
|
||||
In addition, if the player is disposed, the disposal of all its advanced plugin instances will be triggered as well.
|
||||
|
||||
#### Version
|
||||
|
||||
Adding a version number to a plugin is done by defining a `VERSION` property on the plugin before registering it:
|
||||
|
||||
```js
|
||||
ExamplePlugin.VERSION = '1.0.1';
|
||||
|
||||
videojs.registerPlugin('examplePlugin', ExamplePlugin);
|
||||
```
|
||||
|
||||
Retrieve it using `videojs.getPluginVersion`:
|
||||
|
||||
```js
|
||||
var version = videojs.getPluginVersion('examplePlugin');
|
||||
console.log(version); // 1.0.1
|
||||
```
|
||||
|
||||
Note that the [plugin generator](https://github.com/videojs/generator-videojs-plugin) already takes care of adding a version number for you.
|
||||
|
||||
### Advanced Example Advanced Plugin
|
||||
|
||||
What follows is a complete ES6 advanced plugin that logs a custom message when the player's state changes between playing and paused. It uses all the described advanced features:
|
||||
|
||||
gerado
+14150
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
+1
-1
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "video.js",
|
||||
"description": "An HTML5 and Flash video player with a common API and skin for both.",
|
||||
"version": "6.3.0",
|
||||
"version": "6.3.3",
|
||||
"main": "./dist/video.cjs.js",
|
||||
"style": "./dist/video-js.css",
|
||||
"copyright": "Copyright Brightcove, Inc. <https://www.brightcove.com/>",
|
||||
|
||||
@@ -67,7 +67,6 @@ class PlayToggle extends Button {
|
||||
* @listens Player#seeked
|
||||
*/
|
||||
handleSeeked(event) {
|
||||
// remove the ended class
|
||||
this.removeClass('vjs-ended');
|
||||
|
||||
if (this.player_.paused()) {
|
||||
@@ -86,6 +85,7 @@ class PlayToggle extends Button {
|
||||
* @listens Player#play
|
||||
*/
|
||||
handlePlay(event) {
|
||||
this.removeClass('vjs-ended');
|
||||
this.removeClass('vjs-paused');
|
||||
this.addClass('vjs-playing');
|
||||
// change the button text to "Pause"
|
||||
|
||||
@@ -64,7 +64,7 @@ class CurrentTimeDisplay extends TimeDisplay {
|
||||
if (!this.player_.duration()) {
|
||||
return;
|
||||
}
|
||||
this.updateFormattedTime_(this.player.duration());
|
||||
this.updateFormattedTime_(this.player_.duration());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -35,6 +35,21 @@ class RemainingTimeDisplay extends TimeDisplay {
|
||||
return 'vjs-remaining-time';
|
||||
}
|
||||
|
||||
/**
|
||||
* The remaining time display prefixes numbers with a "minus" character.
|
||||
*
|
||||
* @param {number} time
|
||||
* A numeric time, in seconds.
|
||||
*
|
||||
* @return {string}
|
||||
* A formatted time
|
||||
*
|
||||
* @private
|
||||
*/
|
||||
formatTime_(time) {
|
||||
return '-' + super.formatTime_(time);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update remaining time display.
|
||||
*
|
||||
@@ -49,7 +64,13 @@ class RemainingTimeDisplay extends TimeDisplay {
|
||||
return;
|
||||
}
|
||||
|
||||
this.updateFormattedTime_(this.player_.remainingTimeDisplay());
|
||||
// @deprecated We should only use remainingTimeDisplay
|
||||
// as of video.js 7
|
||||
if (this.player_.remainingTimeDisplay) {
|
||||
this.updateFormattedTime_(this.player_.remainingTimeDisplay());
|
||||
} else {
|
||||
this.updateFormattedTime_(this.player_.remainingTime());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -66,10 +66,25 @@ class TimeDisplay extends Component {
|
||||
if (this.textNode_) {
|
||||
this.contentEl_.removeChild(this.textNode_);
|
||||
}
|
||||
this.textNode_ = document.createTextNode(` -${this.formattedTime_ || '0:00'}`);
|
||||
this.textNode_ = document.createTextNode(this.formattedTime_ || '0:00');
|
||||
this.contentEl_.appendChild(this.textNode_);
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates a formatted time for this component to use in display.
|
||||
*
|
||||
* @param {number} time
|
||||
* A numeric time, in seconds.
|
||||
*
|
||||
* @return {string}
|
||||
* A formatted time
|
||||
*
|
||||
* @private
|
||||
*/
|
||||
formatTime_(time) {
|
||||
return formatTime(time);
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the time display text node if it has what was passed in changed
|
||||
* the formatted time.
|
||||
@@ -80,7 +95,7 @@ class TimeDisplay extends Component {
|
||||
* @private
|
||||
*/
|
||||
updateFormattedTime_(time) {
|
||||
const formattedTime = formatTime(time);
|
||||
const formattedTime = this.formatTime_(time);
|
||||
|
||||
if (formattedTime === this.formattedTime_) {
|
||||
return;
|
||||
|
||||
Referência em uma Nova Issue
Bloquear um usuário