Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Seeking issue after resizing player with CSS Transform #28

Open
dikko2000 opened this issue Jul 4, 2016 · 0 comments
Open

Seeking issue after resizing player with CSS Transform #28

dikko2000 opened this issue Jul 4, 2016 · 0 comments

Comments

@dikko2000
Copy link

The player was resized by using CSS "Transform" to fit designer's layout. However, the seeking control had some problem - when dragging the mouse along the circle to seek, the progress indicator does not follow accordingly. And it seemed to jump randomly.

Digging into the code in "circle.player.js", in line 215, I found that function "_getArcPercent()" used jQuery's width()/height() functions to retrieve control's size, and to decide target progress percentage.

x = pageX - offset.left - this.jq.circleControl.width()/2,
y = pageY - offset.top - this.jq.circleControl.height()/2,

Although CSS Tranform changed player compoment size visually, it did not change the intrinsic styles. So, no matter how smaller the progress indicator had become, above code still gave the same original circle control sizes.

Some people have suggested "getBoundingClientRect()" to get actual size. With that, the above code would be

x = pageX - offset.left - this.jq.circleControl[0].getBoundingClientRect().width/2,
y = pageY - offset.top - this.jq.circleControl[0].getBoundingClientRect().height/2,

I have tried and it seems working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant