Skip to content

Commit

Permalink
SUPPORT-1800: Fixed try/catch to catch initialization errors
Browse files Browse the repository at this point in the history
  • Loading branch information
tuj committed Oct 29, 2018
1 parent e80dac0 commit 55bc181
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# itk-os2display/vimeo-bundle CHANGELOG

## 1.0.5

* Fixed try/catch to catch initialization errors as well.

## 1.0.4

* Changed video ID input field to be number field.
Expand Down
15 changes: 9 additions & 6 deletions Resources/public/templates/vimeo/slides/itk-vimeo/itk-vimeo.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ if (!window.slideFunctions['itk-vimeo']) {

var element = document.querySelector('.js-itk-vimeo--player-' + slide.uniqueId);

// Initialize vimeo player.
if (!slide.player) {
slide.player = new Vimeo.Player(element, options);
}

try {
// Initialize vimeo player.
if (!slide.player) {
slide.player = new Vimeo.Player(element, options);
}

var player = slide.player;

// Unregister previous event listeners.
Expand Down Expand Up @@ -88,7 +88,10 @@ if (!window.slideFunctions['itk-vimeo']) {
});
}
catch (err) {
region.nextSlide();
region.itkLog.info("Error running vimeo video, continuing");
region.$timeout((function (region) {
region.nextSlide();
})(region), 1000);
}
}, region.fadeTime);
}
Expand Down

0 comments on commit 55bc181

Please sign in to comment.