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

How to set audio play on sepcial time? #246

Open
nhanlq opened this issue Dec 26, 2017 · 1 comment
Open

How to set audio play on sepcial time? #246

nhanlq opened this issue Dec 26, 2017 · 1 comment

Comments

@nhanlq
Copy link

nhanlq commented Dec 26, 2017

Hi
I want to play audio with special time
Ex: the start from 00:00 to 05:00,
But i want to play with special time is from 02:00 to 05:00
Can you help me?
thanks
Bruce

@yhsang2
Copy link

yhsang2 commented Feb 25, 2018

I wonder about that, too.

audio.js
attachEvents: function(wrapper, audio) {
...
container[audiojs].events.addListener(scrubber, 'click', function(e) {
var relativeLeft = e.clientX - this.getBoundingClientRect().left;
audio.skipTo(relativeLeft / scrubber.offsetWidth);
});
}

um.. Using this function will give you the desired result

ex)

<script> ..... $('btn').click(function(e) { audio.skipTo(0.4); //2/5*100 audio.play(); }); <script> :)

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

2 participants