Comments (7)
Hi @irosenb!
How do you use this @playing
variable on the page?
I have tried the same and this variable works when you reload the page. If you want to update the page when the song info updates you need to update this via JavaScript. Check out the lines just below which render the JSON response and check out how the page is updated in JavaScript:
// public/script.js:85
$('#title' ).text(title)
from so-nice.
Hey @irosenb, any luck with what you were trying?
from so-nice.
@irosenb, did you manage to make it work? Any code that could be added to so-nice?
from so-nice.
No I didn't. The problem was that I wanted to pause the music and have the icons change without latency. It seemed almost impossible. When it got pretty smooth, it would mess up if you paused and played very fast. I haven't worked on it in a while so I'm faintly recalling the problem.
from so-nice.
Interesting problem: because of the latency and network errors they can get out of sync.
A way to solve this would be to remove the fact that ajax events are asynchronous by queuing all the callbacks somehow, but that isn't trivial.
Another thing that could help would be to reduce the latency by removing one ajax request. Right now the buttons do two Ajax requests: one to PUT the action and another to GET the information. If the PUT returned the new information, it would feel 2x faster!
from so-nice.
Another way that comes to mind is to always send and use the current playing state, at every request. So if it does get out of sync it could fall back into place quite quickly.
from so-nice.
Closing this for now. Let me know if you're still fiddling with it and we can reopen.
from so-nice.
Related Issues (20)
- Allow so-nice in iframe HOT 5
- No more background images from Last.FM HOT 5
- missing dependency to json ? (using ruby 1.8.7) HOT 2
- dev setup misses anyplayer (ruby 1.8.7) ? HOT 2
- Have alternating background images
- WIN32OLERuntimeError - failed to create WIN32OLE object from 'iTunes.Application' HOT 6
- Would like to submit simple feature request? (Stop button) HOT 6
- Internal Server Error HOT 4
- Bad background layout on both desktop and mobile HOT 3
- Internal server error HOT 5
- browser incompatibility HOT 1
- Display filename if no tags HOT 5
- New favicon HOT 4
- Images on LastFM's API not working
- sonice's executable "rake" conflicts with anyplayer HOT 4
- Cover art not showing up HOT 1
- Doesn't work for mpd (running on non-standart port + password) HOT 9
- osascript errors HOT 3
- Possibly add pianobar... HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from so-nice.