# Twitch embed Player+Chat editabel channel

**URL:** <https://staging-discuss.dev.twitch.com/t/twitch-embed-player-chat-editabel-channel/24549>\
**Category:** API\
**Created:** [March 21, 2020, 5:53pm UTC](https://staging-discuss.dev.twitch.com/t/twitch-embed-player-chat-editabel-channel/24549 "2020-03-21T17:53:16Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![paciubekeu](https://avatars.discourse-cdn.com/v4/letter/p/7ea924/32.png) [@paciubekeu](https://staging-discuss.dev.twitch.com/u/paciubekeu)\
**Post date:** [March 21, 2020, 5:53pm UTC](https://staging-discuss.dev.twitch.com/t/twitch-embed-player-chat-editabel-channel/24549/1 "2020-03-21T17:53:16Z")

</div>

Hi, i have small problem.  
I want to make twitch player when i click streamer button then open his stream.

```
<script src="https://embed.twitch.tv/embed/v1.js"></script>
<div id="streamwindow"></div>

<script type="text/javascript">
  new Twitch.Embed("streamwindow", {
    parent: ["ravioli.site"],
    width: "100%",
    height: "100%",
    theme: "dark",
    autoplay: true,
  });

  embed.addEventListener(Twitch.Embed.VIDEO_READY, () => {
    var player = embed.getPlayer();
  });
</script>

```

And .js file  
player.setChannel(temp)

temp is streamer name variable

---

<div class="post-metadata">

**Author:** ![BarryCarlyon](https://d1d6mrmdu7ztse.cloudfront.net/user_avatar/staging-discuss.dev.twitch.com/barrycarlyon/32/253_2.png) [@BarryCarlyon](https://staging-discuss.dev.twitch.com/u/BarryCarlyon)\
**Post date:** [March 22, 2020, 11:08am UTC](https://staging-discuss.dev.twitch.com/t/twitch-embed-player-chat-editabel-channel/24549/2 "2020-03-22T11:08:38Z")

</div>

That is not a good idea as if someone clicks the player to pause the stream or change the volume, they’ll be sent to the stream.

The preferred way is to tell users that to visit the stream they just have to hover the player and click the streamers name in the title section, the functionality you need is already built into the player.

 ![image](https://d2spem0quai2ol.cloudfront.net/original/2X/3/39bf02bc26d1e1265175fb0fe2412482a833d8f9.jpeg)

---

<div class="post-metadata">

**Author:** ![paciubekeu](https://avatars.discourse-cdn.com/v4/letter/p/7ea924/32.png) [@paciubekeu](https://staging-discuss.dev.twitch.com/u/paciubekeu)\
**Post date:** [March 22, 2020, 10:30pm UTC](https://staging-discuss.dev.twitch.com/t/twitch-embed-player-chat-editabel-channel/24549/3 "2020-03-22T22:30:37Z")

</div>

I mean when user click special icon the show hidden div with multi channel player with chat. Everything on one site.  
 ![](https://d2spem0quai2ol.cloudfront.net/original/2X/4/4c0f841e33ca4e9589ad8019c5c0a31b107c9d92.png)

 ![](https://d2spem0quai2ol.cloudfront.net/original/2X/2/2aa0f8a22067345fd4c2065cd8a760121c71eb26.jpeg)

---

<div class="post-metadata">

**Author:** ![BarryCarlyon](https://d1d6mrmdu7ztse.cloudfront.net/user_avatar/staging-discuss.dev.twitch.com/barrycarlyon/32/253_2.png) [@BarryCarlyon](https://staging-discuss.dev.twitch.com/u/BarryCarlyon)\
**Post date:** [March 23, 2020, 12:15pm UTC](https://staging-discuss.dev.twitch.com/t/twitch-embed-player-chat-editabel-channel/24549/4 "2020-03-23T12:15:27Z")

</div>

> [@paciubekeu](#):
>
> I mean when user click special icon the show hidden div with multi channel player with chat. Everything on one site.

“special icon”?

I think what you are trying to do is not to go to the streamers page, which is what you wrote

> [@paciubekeu](#):
>
> i click streamer button then open his stream.

but to change what stream is being played in the embed?

```
var player = embed.getPlayer();
player.setChannel(target_channel)

```

> **[Video & Clips](https://dev.twitch.tv/docs/embed/video-and-clips/)**
>
> Embedding Video and Clips

use the `setChannel` function

---

<div class="post-metadata">

**Author:** ![system](https://d2spem0quai2ol.cloudfront.net/original/2X/0/05909729875cce3b53e59d5561c4d23bb14948fc.png) [@system](https://staging-discuss.dev.twitch.com/u/system)\
**Post date:** [April 22, 2020, 12:25pm UTC](https://staging-discuss.dev.twitch.com/t/twitch-embed-player-chat-editabel-channel/24549/5 "2020-04-22T12:25:54Z")

</div>

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