fgl27 / smarttv-twitch

Twitch client for Samsung Smart TVs 2015 and newer models, in doubt read the README bellow
GNU General Public License v3.0
171 stars 18 forks source link

Thumbnails not loading #45

Closed kaldonir closed 5 years ago

kaldonir commented 5 years ago

Since the update, no thumbnails are loading on my TV, there are only black rectangles for Games, Channels, Live Streams, Videos, Clips. Streams themselves play as expected, and I do get preview pictures when I look at my followed channels in the side bar

Visiting the index.html page in a webbrowser loads the thumbnails as expected.

This is the console output when I start up the app on the TV, up to the point where I'd expect to see thumbnails of the most popular channels:

Main_IsNotBrowser tizen = true
Main.js:191 language is de-DE
Screens.js:6 InitScreens place holder
webapis.min.js:1 [productinfo.js] getFirmware  begin
webapis.min.js:1 [productinfo.js] getFirmware  end [object Object]
webapis.min.js:1 [productinfo.js] getFirmware message data T-KTM2DEUC-1260.8
webapis.min.js:1 [productinfo.js] getModel  begin
webapis.min.js:1 [productinfo.js] getModel  end [object Object]
webapis.min.js:1 [productinfo.js] getModel message data UNU8000
Main.js:745 App version: 080219
Main.js:758 Tizen Version: 4.0 | TV: UNU8000 | FW: T-KTM2DEUC-1260.8
VM57:1 Entering setDisplayRect
VM57:1 adding listener
VM57:1 Entered AVPlayManager.prepareAsync()
auto-comment[bot] commented 5 years ago

Thank your for raising a issue. I will try and get back to you as soon as possible. Regards @fgl27

fgl27 commented 5 years ago

I enable this for performance https://github.com/verlok/lazyload sems that is not working on yours TV.

can you debug using this? https://github.com/fgl27/smarttv-twitch/archive/master.zip

because the release does not give the proper logs as is most disable.

After the app finishes load dismiss the controls dialog, and press the key B or green, it will force a reload of the app.

then try to scroll down the page to see what happens on the console window.

after I need you to open the tab that show the html content and navigate to the thumbnail so we can see what is going on, open this frist

Screenshot from 2019-08-02 14-31-11

Then without exiting the "Live screen" open the live screen holder like this Open "scene1" > "screens_holder" > "Live_scroll" > "stream_table_live" > "Live_row0" > "Live_cell0_0" > "Live_thumbdiv0_0" > "<div>"

scroll to see this

Screenshot from 2019-08-02 14-35-34

The "0_0" is the position so it can be different and any one from those will work.

What I wanna to see is if there is any error on the console, and if that tag from the img is there the data-was-processed="true"

because that is the trigger that tells that the image was loaded properly.

Try that and if need some help with the proces let me know.

kaldonir commented 5 years ago

I did use the master version, but that's all the output I get there.

This is a div for which no thumbnail has been loaded, the img does not contain a data-was-process="true":

<div id="Live_thumbdiv18_0" class="stream_thumbnail_clip">
  <div>
    <img id="Live_img18_0" class="lazy stream_img" alt="" data-src="https://static-cdn.jtvnw.net/previews-ttv/live_user_jango_bichouu-640x360.jpg?0.06038071341118467" onerror="this.onerror=null;this.src='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAhAAAAEpBAMAAAAwswZCAAAAJ1BMVEU3NTbV1dU2NDXU1NTDwsOrq6t9fX1IR0dwb3DNzc2cm5xbWlqPj4+TNW2cAAAFhElEQVQYGe3AQYud5R0F8MPhzoxSN4d/buoUgcODtIFs+jCmaUqAuQ1RJJuZFAR3mUHE5TBqQFc3iUHcdVpQoZsE0GxjAcFdRPRz9b2ZmbTfoHKf80NERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERExK8VCRj4/pu3+7Wb3z4FTDQSoyGAhrvvSjt9p/ftd45oA8ZobBgPS6UuqaT5kmgwhtOI99Sl0pkLd4hGjIbAZ+ol9dJKV7+wJInRGB9rRypJpZUuzY9gjIaXTkqnuiZVkr4GMZyf9F9dz9XOM2MoBDa6ulZu/vLB+z8v9Fyfw8Q4GoC/qST1K5/DNLce7qg02SOMcTRuaKXePCZt2r57QyVpDsMYhYl9TepLwM1strl5opK0RwzEr0hd/S/HaECzG0x/qkm9ZoyDuKdS3z60TRiECeILqaT7GEf7w4mk+pdJ2IRNE758Q5OvQAxjo0r9wpEJm2ggCAMfdUlzGCOwDdxTL71lGyvGma2FpL4kRkCCXnRp+ylIwAZxhj9Iql0MwSQ2u6Q/22g0YOLcpa7SRWIINmaaPCII04Zxhnws6Q0MoQF+oNL2MWgQ/8v4pKtriSE0cl/Sn2DDvnzjiXGO/r2kuo0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n7nyMawDHz/zdv92s1vn8LEsIyJG2iCjRiXbYBAA0xjWAZhAAZAgxiX2QgbhpuNcRGACcAgIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiLi/+Y/XKfZaw0ONrwAAAAASUVORK5CYII='">
  </div>
  <div id="Live_infodiv18_0" class="stream_text2">
    <div>
      <div id="Live_title18_0" class="stream_channel" style="width: 66%; display: inline-block;">
        <i class="icon-circle live_icon" style="color: red;"></i> Jango_bichouu
    </div>
    <div id="Live_duration18_0" class="stream_info" style="width:33%; float: right; text-align: right; display: inline-block;">720p60 [FR]</div> 
    </div>
    <div id="Live_createdon18_0" class="stream_info">[FlashLand] La Fin.</div>
    <div id="Live_game18_0" class="stream_info">Playing Grand Theft Auto V</div>
    <div id="Live_viewers18_0" class="stream_info">Since 01:49:39  for 4,138 Viewers</div>
  </div>
</div>

I get the same console output as above.

fgl27 commented 5 years ago

Try again do this change first https://github.com/fgl27/smarttv-twitch/commit/17c427458af1ab9fc87208de104a1b72d648a03f

or redownload the source.

Let me know the result.

kaldonir commented 5 years ago

With this change I get the same result

fgl27 commented 5 years ago

OK I disable it for now. I push the changes close the release apk open again and close this if OK

kaldonir commented 5 years ago

So according to this, my TV does not support the Intersection Observer API, which is used by LazyLoad. For some reason, LazyLoad does not detect that this API is unavailable and the thumbnails won't load.

This discussion on the IntersectionObserver repo describes the necessary checks for availability of that API. I've implemented it in lazyload.js, and with this, lazyload is disabled on my TV, while it is enabled e.g. in my Firefox.

    var supportsIntersectionObserver = runningOnBrowser && "IntersectionObserver" in window 
                                                        && "IntersectionObserverEntry" in window 
                                                        && "intersectionRatio" in window.IntersectionObserverEntry.prototype 
                                                        && "isIntersecting" in window.IntersectionObserverEntry.prototype;

If this works for you as well, this might be the best solution for now?

fgl27 commented 5 years ago

Give me your version of lazy load so I can test

kaldonir commented 5 years ago

https://pastebin.com/Fb3VvuBT

fgl27 commented 5 years ago

Here the normal way and the one you share both return false for me on my TV running Tizen 2.4, on the emulator both ways return true, the emulator is Tizen 5.0.

can you tell me the result of this on yours TV?

console.log('supportsIntersectionObserver ' + (runningOnBrowser && "IntersectionObserver" in window));

Is odd that it doesn't work because of that, that check must be resulting in true for some reason.

I will update again and push the changes let me know the result just for curiosity.

fgl27 commented 5 years ago

I push all changes if doesn't work on the release please let me know.

thanks.

kaldonir commented 5 years ago

console.log('supportsIntersectionObserver ' + (runningOnBrowser && "IntersectionObserver" in window));

This returned true for me.

Yes, release works for me now. Thanks!

fgl27 commented 5 years ago

Yes very odd behavior, thank you for the help.