From ce8170b87b45df7b1090f11688f51881c933a9ee Mon Sep 17 00:00:00 2001 From: Romain Neutron Date: Mon, 4 Jun 2012 18:36:56 +0200 Subject: [PATCH] catch VideoJS exceptions --- templates/web/common/HTML5Video.html.twig | 11 ++++++++--- www/include/jquery.tooltip.js | 10 +++++++++- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/templates/web/common/HTML5Video.html.twig b/templates/web/common/HTML5Video.html.twig index 0ce2149f3f..cafac4ef40 100644 --- a/templates/web/common/HTML5Video.html.twig +++ b/templates/web/common/HTML5Video.html.twig @@ -23,9 +23,14 @@ diff --git a/www/include/jquery.tooltip.js b/www/include/jquery.tooltip.js index 8e48ca9be2..9224b240d2 100644 --- a/www/include/jquery.tooltip.js +++ b/www/include/jquery.tooltip.js @@ -587,7 +587,11 @@ } $.each($('#tooltip video'), function(i,el){ - _V_($(el).attr('id')).destroy(); + try { + _V_($(el).attr('id')).destroy(); + } catch(err) { + console.error('An error has been catched during the execution of VideoJS', err); + } }); helper.body.empty(); @@ -616,7 +620,11 @@ function unfix_tooltip() $.tooltip.current = null; $('#tooltip').hide(); $.each($('#tooltip video'), function(i,el){ + try { _V_($(el).attr('id')).destroy(); + } catch(err) { + console.error('An error has been catched during the execution of VideoJS', err); + } }); $('#tooltip .tooltip_closer').hide(); hideOverlay('_tooltip');