Compare commits
2 commits
0494fd40cf
...
9c544ca46a
Author | SHA1 | Date | |
---|---|---|---|
9c544ca46a | |||
bee3a142c3 |
2 changed files with 7 additions and 4 deletions
|
@ -169,7 +169,7 @@ window.VideoElement = function(options) {
|
|||
function getCurrentTime() {
|
||||
var item = self.items[self.currentItem];
|
||||
var currentTime = self.seeking || self.loading
|
||||
? self.currentTime
|
||||
? (self.currentTime - (self.options["in"] || 0))
|
||||
: item ? item.position + self.video.currentTime - item['in'] - self.options["in"] : 0;
|
||||
return currentTime
|
||||
}
|
||||
|
|
|
@ -364,8 +364,9 @@ window.VideoPlayer = function(options) {
|
|||
that.querySelector('.controls .position input').addEventListener('input', event => {
|
||||
event.preventDefault()
|
||||
event.stopPropagation()
|
||||
setProgressPosition(event.target.value)
|
||||
var position = event.target.value/100 * self.options.duration
|
||||
const value = Math.min(100, Math.max(0, parseFloat(event.target.value))
|
||||
setProgressPosition(value)
|
||||
var position = value/100 * self.options.duration
|
||||
displayTime(position)
|
||||
that.currentTime(position)
|
||||
hideControlsLater()
|
||||
|
@ -386,7 +387,9 @@ window.VideoPlayer = function(options) {
|
|||
if (self.options.position) {
|
||||
currentTime -= self.options.position
|
||||
}
|
||||
setProgressPosition(100 * currentTime / duration)
|
||||
let position = 100 * currentTime / duration
|
||||
position = Math.min(100, Math.max(0, position))
|
||||
setProgressPosition(position)
|
||||
displayTime(currentTime)
|
||||
})
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue