Skip to content

Commit 863a3d7

Browse files
author
yandeqiang
committed
[bugfix] Chimeejs/chimee-mobile-player#12 点击的时候进度条不更新
what: Why: How:
1 parent 295540b commit 863a3d7

File tree

9 files changed

+40
-106
lines changed

9 files changed

+40
-106
lines changed

__test__/e2e/index.js

-79
This file was deleted.

demo/index.html

+27-18
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
<style>
88
body{
99
margin: 0;
10+
/* transform: scale(0.5); */
11+
/* zoom: 0.5; */
1012
}
1113
#wrap{
1214
margin: 0;
@@ -40,28 +42,35 @@
4042
plugin: [
4143
{
4244
name: chimeePluginMobileControlbar.name,
43-
hideBarTime: 100,
44-
children: {
45-
play: {},
46-
currentTime: {},
47-
totalTime: {}
48-
}
45+
hideBarTime: 2000,
4946
// children: {
5047
// play: {},
5148
// currentTime: {},
52-
// progressBar: {},
53-
// totalTime: {},
54-
// screen: {},
55-
// // ok: {
56-
// // tag: 'chimee-control-ok',
57-
// // html: `ok`,
58-
// // event: {
59-
// // tap() {
60-
// // console.log(this)
61-
// // }
62-
// // }
63-
// // }
49+
// totalTime: {},
50+
// screen: {
51+
// event: {
52+
// tap() {
53+
// alert(1)
54+
// }
55+
// }
56+
// }
6457
// }
58+
children: {
59+
play: {},
60+
currentTime: {},
61+
progressBar: {},
62+
totalTime: {},
63+
screen: {},
64+
ok: {
65+
tag: 'chimee-control-ok',
66+
html: `ok`,
67+
event: {
68+
tap() {
69+
console.log(this)
70+
}
71+
}
72+
}
73+
}
6574
}
6675
],
6776
controls: true,

lib/index.browser.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
/**
3-
* chimee-plugin-mobile-controlbar v0.0.9
3+
* chimee-plugin-mobile-controlbar v0.1.0
44
* (c) 2017 yandeqiang
55
* Released under ISC
66
*/
@@ -6268,6 +6268,7 @@ var Base = function () {
62686268
this.option.event && _Object$keys(this.option.event).forEach(function (item) {
62696269
var key = '__' + item;
62706270
_this[key] = bind(_this.option.event[item], _this);
6271+
console.log(_this[key]);
62716272
addDelegate$1(_this.parent, _this.option.tag, item, _this[key], false, false);
62726273
});
62736274
}
@@ -6651,11 +6652,11 @@ var ProgressBar = (_class$1 = function (_Base) {
66516652
this._currentTime = (e.clientX - this.$dom[0].offsetLeft) / this.$dom[0].offsetWidth * this.parent.duration;
66526653
this.update();
66536654
this.parent.currentTime = this._currentTime;
6655+
this._currentTime = undefined;
66546656
}
66556657
}, {
66566658
key: 'mousedown',
66576659
value: function mousedown(e) {
6658-
66596660
this._currentTime = (e.clientX - this.$dom[0].offsetLeft) / this.$dom[0].offsetWidth * this.parent.duration;
66606661
this.startX = e.clientX;
66616662
this.startTime = this._currentTime;

lib/index.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
/**
3-
* chimee-plugin-mobile-controlbar v0.0.9
3+
* chimee-plugin-mobile-controlbar v0.1.0
44
* (c) 2017 yandeqiang
55
* Released under ISC
66
*/
@@ -1399,6 +1399,7 @@ var Base = function () {
13991399
this.option.event && _Object$keys(this.option.event).forEach(function (item) {
14001400
var key = '__' + item;
14011401
_this[key] = chimeeHelper.bind(_this.option.event[item], _this);
1402+
console.log(_this[key]);
14021403
addDelegate(_this.parent, _this.option.tag, item, _this[key], false, false);
14031404
});
14041405
}
@@ -1782,11 +1783,11 @@ var ProgressBar = (_class$1 = function (_Base) {
17821783
this._currentTime = (e.clientX - this.$dom[0].offsetLeft) / this.$dom[0].offsetWidth * this.parent.duration;
17831784
this.update();
17841785
this.parent.currentTime = this._currentTime;
1786+
this._currentTime = undefined;
17851787
}
17861788
}, {
17871789
key: 'mousedown',
17881790
value: function mousedown(e) {
1789-
17901791
this._currentTime = (e.clientX - this.$dom[0].offsetLeft) / this.$dom[0].offsetWidth * this.parent.duration;
17911792
this.startX = e.clientX;
17921793
this.startTime = this._currentTime;

lib/index.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/index.mjs

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
/**
3-
* chimee-plugin-mobile-controlbar v0.0.9
3+
* chimee-plugin-mobile-controlbar v0.1.0
44
* (c) 2017 yandeqiang
55
* Released under ISC
66
*/
@@ -1395,6 +1395,7 @@ var Base = function () {
13951395
this.option.event && _Object$keys(this.option.event).forEach(function (item) {
13961396
var key = '__' + item;
13971397
_this[key] = bind(_this.option.event[item], _this);
1398+
console.log(_this[key]);
13981399
addDelegate(_this.parent, _this.option.tag, item, _this[key], false, false);
13991400
});
14001401
}
@@ -1778,11 +1779,11 @@ var ProgressBar = (_class$1 = function (_Base) {
17781779
this._currentTime = (e.clientX - this.$dom[0].offsetLeft) / this.$dom[0].offsetWidth * this.parent.duration;
17791780
this.update();
17801781
this.parent.currentTime = this._currentTime;
1782+
this._currentTime = undefined;
17811783
}
17821784
}, {
17831785
key: 'mousedown',
17841786
value: function mousedown(e) {
1785-
17861787
this._currentTime = (e.clientX - this.$dom[0].offsetLeft) / this.$dom[0].offsetWidth * this.parent.duration;
17871788
this.startX = e.clientX;
17881789
this.startTime = this._currentTime;

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "chimee-plugin-mobile-controlbar",
3-
"version": "0.0.9",
3+
"version": "0.1.0",
44
"description": "controlbar for chimee in mobile",
55
"main": "lib/index.js",
66
"module": "lib/index.mjs",

src/base.js

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ export default class Base {
3030
this.option.event && Object.keys(this.option.event).forEach(item => {
3131
const key = '__' + item;
3232
this[key] = bind(this.option.event[item], this);
33+
console.log(this[key])
3334
addDelegate(this.parent, this.option.tag, item, this[key], false, false);
3435
});
3536
}

src/progressbar.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,11 @@ export default class ProgressBar extends Base {
7575
this._currentTime = (e.clientX - this.$dom[0].offsetLeft) / this.$dom[0].offsetWidth * this.parent.duration;
7676
this.update();
7777
this.parent.currentTime = this._currentTime;
78+
this._currentTime = undefined;
7879
}
7980

8081
@autobind
8182
mousedown (e) {
82-
8383
this._currentTime = (e.clientX - this.$dom[0].offsetLeft) / this.$dom[0].offsetWidth * this.parent.duration;
8484
this.startX = e.clientX;
8585
this.startTime = this._currentTime;

0 commit comments

Comments
 (0)