Skip to content

Commit

Permalink
fix(xgplayer/[control/mobile.js,pc.js,progress.js style/player.scss])…
Browse files Browse the repository at this point in the history
…: fix playbackrate and definiti
  • Loading branch information
zhangxin92 committed Jul 27, 2018
1 parent f934040 commit de26dbc
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 12 deletions.
4 changes: 2 additions & 2 deletions packages/xgplayer/browser/index.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions packages/xgplayer/dist/index.js

Large diffs are not rendered by default.

7 changes: 6 additions & 1 deletion packages/xgplayer/src/control/mobile.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,12 @@ let mobile = function () {
enter.querySelector('.xgplayer-enter-tips').style.display = 'block'
player.start()
if (pass) {
enterLogo.src = util.getBgImage(logo)
if (player.config.enterLogo) {
enterLogo.src = player.config.enterLogo;
logo.style.backgroundImage = `url("${player.config.enterLogo}")`
} else {
enterLogo.src = util.getBgImage(logo);
}
player.video.addEventListener('touchstart', (e) => {
e.preventDefault()
player.emit('focus')
Expand Down
8 changes: 7 additions & 1 deletion packages/xgplayer/src/control/pc.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,13 @@ let pc = function () {
enterLogo.onload = () => {
enter.querySelector('.xgplayer-enter-tips').style.display = 'block'
}
enterLogo.src = util.getBgImage(logo);
if (player.config.enterLogo) {
enterLogo.src = player.config.enterLogo;
logo.style.backgroundImage = `url("${player.config.enterLogo}")`
} else {
enterLogo.src = util.getBgImage(logo);
}

['click', 'touchstart'].forEach(item => {
btn.addEventListener(item, function (e) {
e.preventDefault()
Expand Down
2 changes: 1 addition & 1 deletion packages/xgplayer/src/control/progress.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ let progress = function () {
}, false)

player.on('timeupdate', function () {
if (!containerWidth) {
if (!containerWidth && container) {
containerWidth = container.getBoundingClientRect().width
}
progress.style.width = `${player.currentTime * 100 / player.duration}%`
Expand Down
15 changes: 10 additions & 5 deletions packages/xgplayer/src/style/player.scss
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,8 @@
display: none;
cursor: pointer;
margin-left: 10px;
margin-top: 8px;
margin-bottom: 12px;
.xgplayer-tips{
margin-left: -20px;
}
Expand All @@ -365,7 +367,7 @@
background: $definitionUlBgColor;
border-radius: 1px;
position: absolute;
bottom: 50px;
bottom: 30px;
left: 0;
text-align: center;
white-space: nowrap;
Expand Down Expand Up @@ -396,13 +398,13 @@
text-align: center;
font-family: PingFangSC-Regular;
font-size: 13px;
line-height: 40px;
line-height: 20px;
height: 20px;
color: $definitionNameColor;
em{
width: 60px;
height: 20px;
line-height: 20px;
padding: 1px 0px;
background: $definitionNameBgColor;
border-radius: 10px;
display:inline-block;
Expand All @@ -421,17 +423,20 @@
display: block;
cursor: pointer;
margin-left: 10px;
margin-top: 8px;
margin-bottom: 12px;
height: 20px;
.name {
text-align: center;
font-family: PingFangSC-Regular;
font-size: 13px;
line-height: 40px;
line-height: 20px;
height: 20px;
color: $definitionNameColor;
span{
width: 40px;
height: 20px;
line-height: 20px;
padding: 1px 10px;
background: $definitionNameBgColor;
border-radius: 10px;
display:inline-block;
Expand Down

0 comments on commit de26dbc

Please sign in to comment.