KoljaWindeler / ytube_music_player

YouTube music player for homeassistant
343 stars 53 forks source link

Don't see progress bar #108

Closed IVNXPTRVOLD closed 3 years ago

IVNXPTRVOLD commented 3 years ago

Screen Shot 2021-07-05 at 20 46 02

KoljaWindeler commented 3 years ago

What Version are you running. Can you copy a screenshot of the state page of the player ... Developer tools -> state, search for the entity

IVNXPTRVOLD commented 3 years ago

What Version are you running. Can you copy a screenshot of the state page of the player ... Developer tools -> state, search for the entity

Screen Shot 2021-07-07 at 08 42 31

KoljaWindeler commented 3 years ago

While playing please

IVNXPTRVOLD commented 3 years ago

While playing please

Screen Shot 2021-07-07 at 08 53 51

KoljaWindeler commented 3 years ago

Strange, there is no media_duration attribute. Are you running the latest version? Is this the same for all tracks?

IVNXPTRVOLD commented 3 years ago

Strange, there is no media_duration attribute. Are you running the latest version? Is this the same for all tracks?

As I know, yep, I use the latest version downloaded just yesterday via HACS. Same for all tracks.

KoljaWindeler commented 3 years ago

ah I know the cause .. your remote player (the device that actually does the playback) doesn't support the _media_duration attribute. Please check the attributes of the media_player.mpd ... that should also lag the media_duration. Those attributes are copied from the remote player to the ytube_music_player attributes ... strange that the MPD supports position but not duration though

IVNXPTRVOLD commented 3 years ago

ah I know the cause .. your remote player (the device that actually does the playback) doesn't support the _media_duration attribute. Please check the attributes of the media_player.mpd ... that should also lag the media_duration. Those attributes are copied from the remote player to the ytube_music_player attributes ... strange that the MPD supports position but not duration though

So, any ideas how to deal with it?

KoljaWindeler commented 3 years ago

Buy a chromecast ;)

IVNXPTRVOLD commented 3 years ago

Buy a chromecast ;)

Google killed Chromecast audio with aux, sadly. Thanks anyway, good integration :)

KoljaWindeler commented 3 years ago

I guess another way to solve it would be to ask the guys of the mpd integration ... They might me able to add that attribute. I guess we can close this here, right?

KoljaWindeler commented 3 years ago

From https://github.com/svenvc/mpdclient

I can see that the status contains those fields: (MPDClient new host: 'audio359') status.

"a Dictionary(

audio->'44100:16:2'

bitrate->618

consume->0

elapsed->54.659

mixrampdb->0.0

nextsong->1

nextsongid->107

playlist->31

playlistlength->8

random->0

repeat->0

single->0

song->0

songid->106

state->'play'

time->'55:291'

volume->95 )"

elapsed is used as position. I'd guess that time could be the total_duration

edit: even better .. the time seems to be elapse:total ..

IVNXPTRVOLD commented 3 years ago

I guess another way to solve it would be to ask the guys of the mpd integration ... They might me able to add that attribute. I guess we can close this here, right?

I have already asked they – https://github.com/Poeschl/Hassio-Addons/issues/257

KoljaWindeler commented 3 years ago

You could try this: https://raw.githubusercontent.com/KoljaWindeler/core/dev/homeassistant/components/mpd/media_player.py you have to replace your mpd/media_player.py file with the linked above. I'm unable to test it https://github.com/KoljaWindeler/core/commit/765a5e2a28ca274977f7e63ef73f84b67ae92691#diff-a7eafacb96b1c85db1f2b13fe416aebba50960c6010e82c3fe84c895ab39c0de

I'll submit a pull request once you can confirm that it works

IVNXPTRVOLD commented 3 years ago

You could try this: https://raw.githubusercontent.com/KoljaWindeler/core/dev/homeassistant/components/mpd/media_player.py you have to replace your mpd/media_player.py file with the linked above. I'm unable to test it KoljaWindeler/core@765a5e2#diff-a7eafacb96b1c85db1f2b13fe416aebba50960c6010e82c3fe84c895ab39c0de

I'll submit a pull request once you can confirm that it works

I use a Home Assistant OS, I guess it is not possible to have access to edit addons

stboch commented 3 years ago

you can make these changes even on home-assistant is just copy mpd everything into a new folder in custom_componets and make the changes in that folder.

KoljaWindeler commented 3 years ago

correct, did you try that @TheUadzhet ?

IVNXPTRVOLD commented 3 years ago

you can make these changes even on home-assistant is just copy mpd everything into a new folder in custom_componets and make the changes in that folder.

I've made a folder but nothing has happened Screen Shot 2021-07-08 at 16 39 23