@eyevinn/web-player 0.8.7 → 0.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -14,10 +14,13 @@ import webplayer from '@eyevinn/web-player';
14
14
  import '@eyevinn/web-player/dist/webplayer.css'; // requires the use of a bundler supporting CSS
15
15
 
16
16
  // assumes the HTML contains an element <div id="player"></div>
17
- const player = webplayer(document.querySelector('#player'));
17
+ const { player, destroy } = webplayer(document.querySelector('#player'));
18
18
  player.load("<src-here>").then(() => {
19
19
  player.play()
20
20
  });
21
+ ...
22
+ // time to cleanup
23
+ destroy();
21
24
  ```
22
25
 
23
26
  ### API
@@ -76,7 +79,7 @@ The snippet below shows an example on how to implement the player
76
79
  <!-- Initiate the player and auto-play (if allowed by browser) -->
77
80
  <script>
78
81
  document.addEventListener('DOMContentLoaded', function(event) {
79
- const player = webplayer(document.querySelector("#player-wrapper"));
82
+ const { player } = webplayer(document.querySelector("#player-wrapper"));
80
83
  player.load(src).then(function() {
81
84
  player.play();
82
85
  });