fix #493 (error when removing a not-yet-loaded video from the dom)

This commit is contained in:
rlx 2012-02-17 10:41:38 +00:00
parent 23c319d95a
commit 3407f36d12

View file

@ -176,8 +176,10 @@ Ox.VideoElement = function(options, self) {
},
stop: function() {
// custom event to be triggered on removal from the DOM
self.video.pause();
self.video.src = '';
if (self.video) {
self.video.pause();
self.video.src = '';
}
that.triggerEvent('ended');
}
})