MiczFlor / RPi-Jukebox-RFID

A Raspberry Pi jukebox, playing local music, podcasts, web radio and streams triggered by RFID cards, web app or home automation. All plug and play via USB. GPIO scripts available.
http://phoniebox.de
MIT License
1.37k stars 398 forks source link

Jump to a certain time „on a line“ in WebApp #301

Open harryliebteuch opened 5 years ago

harryliebteuch commented 5 years ago

I would be happy if there is a timeline in the WebApp in which I could Jump to a certain. That's great for long files. I mean something that every player has on the lower edge like z.b. the VLC, or Youtube

princemaxwell commented 5 years ago

I think this will not possible. The fact is that we have not really a music player. We control a music protocol by command line. The only thing we can is seek seconds or minutes for- and backwards.

What could be possible is a timeline bar in the web UI. But without control feature.

Franzformator commented 5 years ago

Would it may be possible to get a drop-down-list with certain time steps to jump to a specific section?

For example:

princemaxwell commented 5 years ago

We cannot seek to a specific section. What we can do is seeking by percentage.

The only way to seek for- and backwards is this option

seek [+-][] or <[+-]<0-100>%> Seeks by hour, minute or seconds, hours or minutes can be omitted. If seeking by percentage, seeks within the current song in the specified manner. If a "+" or "-" is used, the seek is done relative to the current song position. Absolute seeking by default.

Please have a look here for all available commands: https://linux.die.net/man/1/mpc

MiczFlor commented 5 years ago

Hi @harryliebteuch it's a nice idea and could be done in a rough way. Similar to what @Franzformator suggests. I won't prioritise it, because (and that's the essence of @princemaxwell comment): The web app is controlling mpd which would need to communicate to the web app via ajax to tell the browser where in the timeline the file currently is playing. To do that in real time would put a lot of CPU strain and battery drain onto your Raspberry. A rough solution would imply to do something like this:

However, at the current set up that would allow to jump to the beginning and nine other positions in the file "on click" and that click would reload the page after triggering the seek command. The ajax realtime element would then make the timeline more useable, because it could (with some css magic) highlight the time that has advanced in the playout. So, yes, it could be done in a rough way, but the setup is not ideal to turn the web app into a player app. It might be time somebody in the community writes and Android App? Anyone?

princemaxwell commented 5 years ago

@harryliebteuch We could use the seek command of MPC for that. Its possible to seek by seconds or by percentage.

so the easiest way would be to add a swipe action for 5%, 10%, 20% and so on. Or we add additional seek buttons +10% +20% to web app? Thats what @Franzformator suggested. As longer the file, as longer the jump.

What did you mean @MiczFlor ?