Get channel is being watched

Hey guys, I’m developing a Twitch Extension to communicate with my site and show different screens for Broadcaster and Viewers.

I need a way to know what channel my viewer is watching to retrieve his streamer info from my API. Is there a way to do this? So I can show the info for my viewers and I’ll get another info from my API to show for my broadcaster. Is there a way to get the current being watched broadcaster info?

As an extension then the viewer is watching/using your extension on the channel it’s installed upon.

So not sure what you are looking for here.

The channel_id is returned in the onAuthorised callback.
So you know which channel the extension is installed upon.

I’m trying to do this, but the Twitch.ext is giving me the same channel_id for two channels

Follow the images

Screen Shot 2021-08-10 at 14.52.44

Then you are looking at the extension on the same twitch page.

You cannot “see” if a viewer is on/watching a different channel.
If that channel doesn’t also have the etension installed.
Then all you know is that they have loaded your extension.

There is no Twitch API to know what someone is watching.
And all an extension will do is.tell you that they have the page loaded

This looks like the developer rig.

This suggests you have misconfigured the test environment of the rig.

(Only changed the channel displayed not changed the channel_id that the extension is on)

IE you only changed the right value and not the left value.

So if I want to simulate that my viewer is watching a streamer different than me what I need to do? Change the display channel and use developer rig user?

I configured this way

But it doesn’t make sense. If my viewer is watching a channel his Id can’t be equal with the channel_id because it’s his stream

Solved, I think!

It was a problem with my configuration. I didn’t configured the view as Viewer with shared identity.

This solved my problem

The “Frame Properties” (left) value sets the channel_id that the Extension Helper returns.

The “Display Channel” (right) just changes what stream is embedded and ahs no bearing on the extension helper.

This only changes the user_id not the channel_id