Skip to content

Commit

Permalink
fix(player): Added conditionals to ensure elements will be removed if…
Browse files Browse the repository at this point in the history
… they exist; removed link from documentation
  • Loading branch information
Rafael Miranda committed May 31, 2022
1 parent 54171bc commit a059236
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 7 deletions.
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -42,9 +42,9 @@ So, please consider this before upgrading to any of the 3.x.x version going forw

| | | |
|--|--|--|
|[![MedSims](https://img.medscapestatic.com/pi/global/icons/icon-medsims-logo@2x.png)](https://www.medscape.org/simulation) | [![Arrow Classic Rock](https://player.arrow.nl/tmp/images/logo.1507670326.jpg)](https://player.arrow.nl/ad.html) | [![Uttlesford District Council](https://uttlesford.moderngov.co.uk/SiteSpecific/res/img/uttlesfordlogo.png)](https://uttlesford.moderngov.co.uk/ieListDocuments.aspx?CId=159&MId=5501)|
|[![MedSims](https://img.medscapestatic.com/pi/global/icons/icon-medsims-logo@2x.png)](https://www.medscape.org/simulation) | [![Arrow Classic Rock](https://player.arrow.nl/tmp/images/logo.1507670326.jpg)](https://player.arrow.nl/ad.html) | [![Geração Rádios](https://user-images.githubusercontent.com/910829/168053773-8871dcf9-1f3a-4487-9f6d-95d4d461d945.png)](https://geracaoradios.com) |
|[![LectureTube](https://live.video.tuwien.ac.at/room/assets/lecturetube_landscape.svg)](<https://live.video.tuwien.ac.at/room/heart0/player.html>)| [Servicio Online](https://40152354.servicio-online.net//INDEX.html)|[![HitRadio Center](https://user-images.githubusercontent.com/910829/155380459-76856a41-5a19-4831-8ef8-6d0ae8d471f0.svg)](https://radiocenter.si)|
|[![Rock Radio](https://user-images.githubusercontent.com/910829/155380461-9c74ff57-50a2-419c-b85a-dad8810b42c6.svg)](https://rockradio.si)| [![Geração Rádios](https://user-images.githubusercontent.com/910829/168053773-8871dcf9-1f3a-4487-9f6d-95d4d461d945.png)](https://geracaoradios.com) |
|[![Rock Radio](https://user-images.githubusercontent.com/910829/155380461-9c74ff57-50a2-419c-b85a-dad8810b42c6.svg)](https://rockradio.si)| |

## Migrating from older version to new ones

Expand Down
9 changes: 7 additions & 2 deletions dist/openplayer.js
Expand Up @@ -8377,8 +8377,13 @@ var Player = function () {
}

if (isVideo(player_classPrivateFieldGet(this, _Player_element, "f"))) {
this.playBtn.remove();
this.loader.remove();
if (this.playBtn) {
this.playBtn.remove();
}

if (this.loader) {
this.loader.remove();
}
}

if ((_a = player_classPrivateFieldGet(this, _Player_options, "f")) === null || _a === void 0 ? void 0 : _a.onError) {
Expand Down
2 changes: 1 addition & 1 deletion dist/openplayer.min.js

Large diffs are not rendered by default.

8 changes: 6 additions & 2 deletions src/js/player.ts
Expand Up @@ -223,8 +223,12 @@ class Player {
}

if (isVideo(this.#element)) {
this.playBtn.remove();
this.loader.remove();
if (this.playBtn) {
this.playBtn.remove();
}
if (this.loader) {
this.loader.remove();
}
}

if (this.#options?.onError) {
Expand Down

0 comments on commit a059236

Please sign in to comment.