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

Play/pause toggle #17

Open
grahamharper opened this issue Oct 24, 2014 · 8 comments
Open

Play/pause toggle #17

grahamharper opened this issue Oct 24, 2014 · 8 comments

Comments

@grahamharper
Copy link

How would you go about setting up a control that toggles between play and pause rather than two separate controls on screen?

@Wildhoney
Copy link
Owner

Use the Controls directive in your template, from there you have access to the playing property where you can determine its state – simply hide/show buttons depending on that state.

JSFiddle example.

@grahamharper
Copy link
Author

Thanks for responding so quick. I actually tried that but there is a moment after you click either button that the other is visible. I thought there might be a better way?
play-pause-toggle

@Wildhoney
Copy link
Owner

That seems strange, because I don't see that behaviour in the JSFiddle which presumably uses the same technique as you're using. Could you please try and replicate this delay in the fiddle?

@farazhassan
Copy link

Exactly the same thing happens to my code.. Do mention here if any solution is found. I wanted to write earlier but then saw the JSFiddle Adam posted and stopped thinking i might have done something wrong and will recheck my own code but now, I think the issue is with not my code but the library

@grahamharper
Copy link
Author

I'm building an app with Ionic and I was able to reproduce the problem on plunker. This might be an Ionic problem as I noticed if I use version 1.0.0-beta.5 of Ionic there is no issue. Any version since has the delay.

@Wildhoney
Copy link
Owner

@farazhassan Are you also using Ionic?

@farazhassan
Copy link

Nope. Angular with anmgular-bootstrap-ui. Thats all.

@MrViSiOn
Copy link

This is not working for me...

                      <section vi-controls>
                        <a vi-controls-play ng-hide="playing">
                            <i class="icon icon--xl icon--green icon--flat mdi mdi-play"></i>
                        </a>
                        <a vi-controls-pause ng-show="playing">
                            <i class="icon icon--xl icon--green icon--flat mdi mdi-pause"></i>
                        </a>
                    </section>

Not 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

4 participants