});
},
removeAllVideos: function () {
+ var $this = this;
this.getActivePlayers().forEach(function (player) {
+ $this.disposeVideo(player);
+ });
+ },
- var id = player.id();
-
- // Save the current player info if it has started
- if (player.hasStarted()) {
- fluidbook.video.players[id] = {
- currentTime: player.currentTime(),
- volume: player.volume(),
- muted: player.muted(),
- paused: player.paused()
- };
- }
+ disposeVideo: function (player) {
+ var id = player.id();
+
+ // Save the current player info if it has started
+ if (player.hasStarted()) {
+ fluidbook.video.players[id] = {
+ currentTime: player.currentTime(),
+ volume: player.volume(),
+ muted: player.muted(),
+ paused: player.paused()
+ };
+ }
- //fb('Disposing video ID ' + id);
- player.dispose();
- });
+ //fb('Disposing video ID ' + id);
+ player.dispose();
+ return id;
},
getActivePlayers: function () {
},
killVideosIn: function (e) {
- $(e).find('video').each(function () {
- this.pause();
- this.src = "";
+ var $this = this;
+ $(e).find('.videoContainer').each(function () {
+ var id = $(this).data('id');
+ var player = videojs(id);
+ $this.disposeVideo(player);
});
},
};
\ No newline at end of file