# WowzaPlayer.destroy is not a function

**URL:** <https://community.wowza.com/t/wowzaplayer-destroy-is-not-a-function/48484>\
**Category:** Wowza Developer Dojo\
**Tags:** wowza-player-javascript-api\
**Created:** [April 10, 2017, 3:43am UTC](https://community.wowza.com/t/wowzaplayer-destroy-is-not-a-function/48484 "2017-04-10T03:43:16Z")\
**Posts on this page:** 2\
**Page:** 1

<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:** [April 10, 2017, 3:43am UTC](https://community.wowza.com/t/wowzaplayer-destroy-is-not-a-function/48484/1 "2017-04-10T03:43:16Z")

</div>

I’m using lastest javascript api of wowzaPlayer.

Why not a function destroy?

---

<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:** [April 11, 2017, 2:13am UTC](https://community.wowza.com/t/wowzaplayer-destroy-is-not-a-function/48484/2 "2017-04-11T02:13:02Z")

</div>

## Stop a WowzaPlayer instance

The WowzaPlayer.destroy static method deallocates the WowzaPlayer instance that was created with the specified PlayerElement player ID.

destroy ( PlayerElement : string ) : WowzaPlayer

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

**(not working)**

I changed

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

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

**myPlayer.destroy();**

**}**

it’s working
