# How to destroy an existing instance so multiple streams do not play simultaneously?

**URL:** <https://community.wowza.com/t/how-to-destroy-an-existing-instance-so-multiple-streams-do-not-play-simultaneously/174>\
**Category:** Wowza Developer Dojo\
**Tags:** wowza-player-javascript-api\
**Created:** [December 6, 2016, 3:42pm UTC](https://community.wowza.com/t/how-to-destroy-an-existing-instance-so-multiple-streams-do-not-play-simultaneously/174 "2016-12-06T15:42:52Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/system/32/447_2.png) [@system](https://community.wowza.com/u/system)\
**Post date:** [December 6, 2016, 3:42pm UTC](https://community.wowza.com/t/how-to-destroy-an-existing-instance-so-multiple-streams-do-not-play-simultaneously/174/1 "2016-12-06T15:42:52Z")

</div>

I am making new instances of

WowzaPlayer.create(‘playerElement’,

etc

etc

I end up with all videos playing at once. How do I destroy the existing one before making a new one?

Thanks,

---

<div class="post-metadata">

**Author:** ![alan\_costello](https://avatars.discourse-cdn.com/v4/letter/a/c89c15/32.png) [@alan\_costello](https://community.wowza.com/u/alan_costello)\
**Post date:** [December 9, 2016, 9:43pm UTC](https://community.wowza.com/t/how-to-destroy-an-existing-instance-so-multiple-streams-do-not-play-simultaneously/174/2 "2016-12-09T21:43:36Z")

</div>

It was happening when two streams were called in quick succession, so i put something to detect that situation in the code.

---

<div class="post-metadata">

**Author:** ![alan\_costello](https://avatars.discourse-cdn.com/v4/letter/a/c89c15/32.png) [@alan\_costello](https://community.wowza.com/u/alan_costello)\
**Post date:** [December 13, 2016, 3:38pm UTC](https://community.wowza.com/t/how-to-destroy-an-existing-instance-so-multiple-streams-do-not-play-simultaneously/174/3 "2016-12-13T15:38:39Z")

</div>

My problem was calling the channel within the software twice quickly, not people clicking. It should be built into the player, though.

I prevented calling the new stream too quickly by writing some code - I couldn’t find a way to stop that behavior in the wowza player.

ys

---

<div class="post-metadata">

**Author:** ![tom\_hank](https://avatars.discourse-cdn.com/v4/letter/t/8baadc/32.png) [@tom\_hank](https://community.wowza.com/u/tom_hank)\
**Post date:** [December 13, 2016, 2:01am UTC](https://community.wowza.com/t/how-to-destroy-an-existing-instance-so-multiple-streams-do-not-play-simultaneously/174/4 "2016-12-13T02:01:17Z")

</div>

I’m having the same issue, you have no way to do yet?

---

<div class="post-metadata">

**Author:** ![ha\_nguyen](https://avatars.discourse-cdn.com/v4/letter/h/54ee81/32.png) [@ha\_nguyen](https://community.wowza.com/u/ha_nguyen)\
**Post date:** [May 23, 2017, 7:30am UTC](https://community.wowza.com/t/how-to-destroy-an-existing-instance-so-multiple-streams-do-not-play-simultaneously/174/5 "2017-05-23T07:30:44Z")

</div>

**var myPlayer = WowzaPlayer.get(‘playerElement’);**

**if (myPlayer != null) {**

**myPlayer.destroy();**

**}**

---

<div class="post-metadata">

**Author:** ![Weijing\_Lin1](https://avatars.discourse-cdn.com/v4/letter/w/49beb7/32.png) [@Weijing\_Lin1](https://community.wowza.com/u/Weijing_Lin1)\
**Post date:** [March 21, 2020, 3:01am UTC](https://community.wowza.com/t/how-to-destroy-an-existing-instance-so-multiple-streams-do-not-play-simultaneously/174/6 "2020-03-21T03:01:00Z")

</div>

after destroy, I still continuously receiving the data…
