videojs-wavesurfer
Advanced tools
Comparing version 0.3.0 to 0.4.0
{ | ||
"name": "videojs-wavesurfer", | ||
"version": "0.3.0", | ||
"version": "0.4.0", | ||
"homepage": "https://github.com/collab-project/videojs-wavesurfer", | ||
@@ -5,0 +5,0 @@ "description": "video.js plugin that adds a navigable waveform for audio files.", |
{ | ||
"name": "videojs-wavesurfer", | ||
"version": "0.3.0", | ||
"version": "0.4.0", | ||
"description": "video.js plugin that adds a navigable waveform for audio files.", | ||
@@ -23,4 +23,9 @@ "main": "videojs.wavesurfer.js", | ||
], | ||
"dependencies": { | ||
"video.js": ">=4.6", | ||
"wavesurfer.js": ">=1.0.0" | ||
}, | ||
"author": "", | ||
"license": "MIT", | ||
"readmeFilename": "README.md", | ||
"bugs": { | ||
@@ -27,0 +32,0 @@ "url": "https://github.com/collab-project/videojs-wavesurfer/issues" |
@@ -13,5 +13,5 @@ Video.js Wavesurfer | ||
You can use [bower](http://bower.io) to install the plugin | ||
(`bower install videojs-wavesurfer`), or simply download and include | ||
`videojs.wavesurfer.js` in your project. | ||
You can use [bower](http://bower.io) (`bower install videojs-wavesurfer`) or | ||
[npm](https://www.npmjs.org) (`npm install videojs-wavesurfer`) to install the | ||
plugin, or download and include `videojs.wavesurfer.js` in your project. | ||
@@ -48,14 +48,15 @@ The plugin depends on the wavesurfer.js and video.js packages: | ||
{ | ||
"controls": true, | ||
"autoplay": true, | ||
"loop": false, | ||
"width": 600, | ||
"height": 300, | ||
"plugins": { | ||
"wavesurfer": { | ||
"src": "media/heres_johnny.wav", | ||
"waveColor": "grey", | ||
"progressColor": "black", | ||
"cursorColor": "black", | ||
"hideScrollbar": true | ||
controls: true, | ||
autoplay: true, | ||
loop: false, | ||
width: 600, | ||
height: 300, | ||
plugins: { | ||
wavesurfer: { | ||
src: "media/heres_johnny.wav", | ||
msDisplayMax: 10, | ||
waveColor: "grey", | ||
progressColor: "black", | ||
cursorColor: "black", | ||
hideScrollbar: true | ||
} | ||
@@ -69,2 +70,8 @@ } | ||
The `msDisplayMax` plugin option is an optional setting that defaults to 3 sec. | ||
It indicates the number of seconds that is considered the boundary value for | ||
displaying milliseconds in the time controls. An audio clip with a total | ||
length of 2 seconds and a `msDisplayMax` of 3 will use the format `M:SS:MMM`. | ||
Clips longer than `msDisplayMax` will be displayed as `M:SS` or `HH:MM:SS`. | ||
License | ||
@@ -71,0 +78,0 @@ ------- |
@@ -34,9 +34,17 @@ // Copyright Collab 2014 | ||
// indicates the number of seconds that is considered | ||
// the boundary value for displaying milliseconds in the | ||
// time controls. An audio clip with a total length of | ||
// 2 seconds with a msDisplayMax of 3 will be displayed | ||
// as M:SS:MMM. Clips longer than msDisplayMax will be | ||
// displayed as M:SS or HH:MM:SS. | ||
this.msDisplayMax = 3; | ||
if (this.options().options.msDisplayMax !== undefined) | ||
{ | ||
// msDisplayMax indicates the number of seconds that is | ||
// considered the boundary value for displaying milliseconds | ||
// in the time controls. An audio clip with a total length of | ||
// 2 seconds and a msDisplayMax of 3 will use the format | ||
// M:SS:MMM. Clips longer than msDisplayMax will be displayed | ||
// as M:SS or HH:MM:SS. | ||
this.msDisplayMax = parseFloat(this.options().options.msDisplayMax); | ||
} | ||
else | ||
{ | ||
// default | ||
this.msDisplayMax = 3; | ||
} | ||
@@ -61,4 +69,2 @@ // customize controls | ||
this.player().controlBar.volumeControl.el().style.marginRight = '15px'; | ||
// waveform events | ||
@@ -93,3 +99,3 @@ this.surfer = Object.create(WaveSurfer); | ||
// start loading | ||
if (options.src != undefined) | ||
if (options.src !== undefined) | ||
{ | ||
@@ -184,4 +190,4 @@ this.load(options.src); | ||
{ | ||
var duration = this.surfer.backend.getDuration(); | ||
var currentTime = this.surfer.backend.getCurrentTime() | ||
var duration = this.surfer.getDuration(); | ||
var currentTime = this.surfer.getCurrentTime(); | ||
var time = Math.min(currentTime, duration); | ||
@@ -200,3 +206,3 @@ | ||
{ | ||
var duration = this.surfer.backend.getDuration(); | ||
var duration = this.surfer.getDuration(); | ||
@@ -225,3 +231,3 @@ // update control | ||
// display milliseconds | ||
if (this.surfer.backend.getDuration() < this.msDisplayMax) | ||
if (this.surfer.getDuration() < this.msDisplayMax) | ||
{ | ||
@@ -446,3 +452,3 @@ this.player().controlBar.durationDisplay.el().style.width = | ||
this.el().appendChild(this.waveform.el()); | ||
}; | ||
} | ||
@@ -449,0 +455,0 @@ // register the plugin |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
136076
13
525
78
2
+ Addedvideo.js@>=4.6
+ Addedwavesurfer.js@>=1.0.0
+ Added@babel/runtime@7.26.0(transitive)
+ Added@videojs/http-streaming@3.15.0(transitive)
+ Added@videojs/vhs-utils@4.1.1(transitive)
+ Added@videojs/xhr@2.7.0(transitive)
+ Added@xmldom/xmldom@0.8.10(transitive)
+ Addedaes-decrypter@4.0.2(transitive)
+ Addeddom-walk@0.1.2(transitive)
+ Addedglobal@4.4.0(transitive)
+ Addedis-function@1.0.2(transitive)
+ Addedm3u8-parser@7.2.0(transitive)
+ Addedmin-document@2.19.0(transitive)
+ Addedmpd-parser@1.3.1(transitive)
+ Addedmux.js@7.0.37.1.0(transitive)
+ Addedpkcs7@1.0.4(transitive)
+ Addedprocess@0.11.10(transitive)
+ Addedregenerator-runtime@0.14.1(transitive)
+ Addedvideo.js@8.19.2(transitive)
+ Addedvideojs-contrib-quality-levels@4.1.0(transitive)
+ Addedvideojs-font@4.2.0(transitive)
+ Addedvideojs-vtt.js@0.15.5(transitive)
+ Addedwavesurfer.js@7.8.8(transitive)