MediaBrowser / Emby.Roku

Emby for Roku
http://emby.media
MIT License
78 stars 54 forks source link

Fix flickering "Now Playing" display #141

Open speechles opened 8 years ago

speechles commented 8 years ago

This fixes the flickering between theme song and what is playing.

http://emby.media/community/index.php?/topic/15708-theme-music-reporting-being-played-when-its-finished/

See the above thread for more information.

LukePulverenti commented 8 years ago

Just double check that playback stop is not reported twice in the server dashboard. can you confirm? also, why remove the timeline cleanup line?

speechles commented 8 years ago

It is reported stopped twice. But always has been. If you don't issue both of those, the flickering keeps at it. As far as remove the cleanup line. This is what makes audio now playable in the background. That cleanup makes it stop as you as you leave the musicscreen. Removing it has shown no ill effect for me at all and I've tested several scenarios.

There are more fixes that rely on music, such as, you should not rely on "AudioPlayer().isPlaying" to show the "Now Playing" icon of the options row on the homescreen. It should be "AudioPlayer().Context <> invalid" to tell.. But these are things for another day.

LukePulverenti commented 8 years ago

I guess my question is, the timeline timer fires every 1000ms to report progress, so why should this be left running after stopping?

Sub audioPlayerOnTimerExpired(timer) if timer.Name = "timeline" m.UpdateNowPlaying() m.reportPlayback("progress") end if End Sub

speechles commented 8 years ago

I tried that luke.. honestly.. here is that section of code I use:

Sub audioPlayerClearContent() m.reportPlayback("stop") m.Stop() GetGlobalAA().AddReplace("musicstop", "1") GetGlobalAA().AddReplace("AudioConflict", "1") 'm.timelineTimer = invalid 'm.IgnoreTimelines = true 'm.player.ClearContent() 'fn = function() :m.AudioPlayer = invalid :end function 'fn() End Sub

Those two global lines help me determine when to show conflicting context menus. If you set the timelineTimer invalid the flickering returns for some reason. If you want to test this and do more investigation by all means. But I did this long ago and these are the conclusions I came to.