Embedding Twitch Player in an Android app

Sorry if it’s not the right category, but it seems that there is no right category
Note: I posted this on reddit here and had no success

Hi

I’m working on an app which allows the user to view streams from various sources. I’ve been using Twitch’s HLS .m3u8 file directly using an ExoMedia player until now, and now that the app gets closer to being done, I would like to comply with the ToS: I want to show Twitch ads.

I tried to embed the Twitch player in a WebView again and again using a lot of different ways, and didn’t manage to achieve anything. I tried the following:

The best I could have was what sounded like an ad playing, just the sound with a black screen, then nothing else than a broken player (doesn’t react to interaction). Using the best way for me, the interactive JS player, I just get a black screen. The only log I ever had was this (below), and it’s just a warning.

I/chromium﹕ [INFO:CONSOLE(3)] "failed to resolve properties promise", source: http://player.twitch.tv/js/player.f19e7bd5.js (3)

I’m testing on Android 4.4 and need to support Android 4.2+.
Why is it so hard to have something working? Dailymotion proved it’s possible, their player works on anything. Can I play Twitch ads in my ExoMedia player somehow? I really want to comply with the ToS.

I was told to try &html5 to use the currently in dev player (or at least that’s what I understood), here is the result:

With this I get HTML5 controls with title, streamer pic etc., but other than that I get the same result than before: black screen and a twitch logo. I, however, got some more logs this time.

I/chromium﹕ [INFO:CONSOLE(1)] "pre-main prep time: 247 ms", source: http://player.twitch.tv/vendor/hls.36db8b8b.js (1)
I/chromium﹕ [INFO:CONSOLE(3)] "failed to resolve properties promise", source: http://player.twitch.tv/js/player.f19e7bd5.js (3)
I/chromium﹕ [INFO:CONSOLE(1)] "loading playlist medium: http://video-edge-49860c.cdg01.hls.ttvnw.net/hls-8c6c2c/lainkk_20051007968_413762872/medium/py-index-live.m3u8?token=id=1318183592110773143,bid=20051007968,exp=1457462322,node=video-edge-49860c-1.cdg01.hls.justin.tv,nname=video-edge-49860c.cdg01,fmt=medium&sig=8821d3d985a18ece20bce675b8442b3163be486b", source: http://player.twitch.tv/vendor/hls.36db8b8b.js (1)
I/chromium﹕ [INFO:CONSOLE(1)] "loading segment #1416: http://video-edge-49860c.cdg01.hls.ttvnw.net/hls-8c6c2c/lainkk_20051007968_413762872/medium/index-0000001417-8D0C.ts", source: http://player.twitch.tv/vendor/hls.36db8b8b.js (1)

The last two lines kinda repeat with different segment numbers.

I didn’t really tested it, but from what I know of Android 5+, the player should work on it. My idea was to use the Twitch player for Android 5+ and fallback to my working no-ads player on Android 4… Which still doesn’t really comply with the ToS. What should I do? We need an answer from Twitch on this

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.