Skip to content

Commit e16f4e7

Browse files
committed
Added error handling to demo pages
1 parent c216213 commit e16f4e7

File tree

6 files changed

+30
-0
lines changed

6 files changed

+30
-0
lines changed

demo/cue-events.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,11 @@ <h2>Points</h2>
337337
};
338338

339339
Peaks.init(options, function(err, peaksInstance) {
340+
if (err) {
341+
console.error(err.message);
342+
return;
343+
}
344+
340345
console.log("Peaks instance ready");
341346

342347
document.querySelector('[data-action="zoom-in"]').addEventListener('click', function() {

demo/custom-markers.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -594,6 +594,11 @@ <h2>Points</h2>
594594
};
595595

596596
Peaks.init(options, function(err, peaksInstance) {
597+
if (err) {
598+
console.error(err.message);
599+
return;
600+
}
601+
597602
console.log("Peaks instance ready");
598603

599604
document.querySelector('[data-action="zoom-in"]').addEventListener('click', function() {

demo/index.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,11 @@ <h2>Points</h2>
342342
};
343343

344344
Peaks.init(options, function(err, peaksInstance) {
345+
if (err) {
346+
console.error(err.message);
347+
return;
348+
}
349+
345350
console.log("Peaks instance ready");
346351

347352
document.querySelector('[data-action="zoom-in"]').addEventListener('click', function() {

demo/overview-waveform.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,11 @@ <h2>Demo: Single Fixed Waveform</h2>
124124
};
125125

126126
Peaks.init(options, function(err, peaksInstance) {
127+
if (err) {
128+
console.error(err.message);
129+
return;
130+
}
131+
127132
console.log('Peaks instance ready');
128133

129134
document.querySelector('button[data-action="seek"]').addEventListener('click', function(event) {

demo/webaudio.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,11 @@ <h2>Points</h2>
250250
};
251251

252252
Peaks.init(options, function(err, peaksInstance) {
253+
if (err) {
254+
console.error(err.message);
255+
return;
256+
}
257+
253258
console.log('Peaks instance ready');
254259

255260
document.querySelector('[data-action="zoom-in"]').addEventListener('click', function() {

demo/zoomable-waveform.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,11 @@ <h2>Demo: Single Zoomable Waveform</h2>
136136
};
137137

138138
Peaks.init(options, function(err, peaksInstance) {
139+
if (err) {
140+
console.error(err.message);
141+
return;
142+
}
143+
139144
console.log('Peaks instance ready');
140145

141146
var zoomview = peaksInstance.views.getView('zoomview');

0 commit comments

Comments
 (0)