@internetarchive/radio-player 0.0.3-a4 → 0.0.4-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/LICENSE +661 -661
  2. package/README.md +142 -142
  3. package/index.d.ts +15 -15
  4. package/index.js +28 -28
  5. package/lib/demo/full-text-search-service.d.ts +14 -14
  6. package/lib/demo/full-text-search-service.js +33 -33
  7. package/lib/demo/radio-player-controller.d.ts +41 -41
  8. package/lib/demo/radio-player-controller.js +199 -199
  9. package/lib/src/assets/img/left.d.ts +2 -2
  10. package/lib/src/assets/img/left.js +15 -15
  11. package/lib/src/assets/img/right.d.ts +2 -2
  12. package/lib/src/assets/img/right.js +15 -15
  13. package/lib/src/models/music-zone.d.ts +12 -12
  14. package/lib/src/models/music-zone.js +15 -15
  15. package/lib/src/models/radio-player-config.d.ts +26 -26
  16. package/lib/src/models/radio-player-config.js +27 -27
  17. package/lib/src/radio-player.d.ts +589 -589
  18. package/lib/src/radio-player.js +1338 -1338
  19. package/lib/src/search-handler/search-backends/full-text-search-backend/full-text-search-backend.d.ts +82 -82
  20. package/lib/src/search-handler/search-backends/full-text-search-backend/full-text-search-backend.js +107 -107
  21. package/lib/src/search-handler/search-backends/full-text-search-backend/full-text-search-response.d.ts +48 -48
  22. package/lib/src/search-handler/search-backends/full-text-search-backend/full-text-search-response.js +58 -58
  23. package/lib/src/search-handler/search-backends/full-text-search-backend/full-text-search-service-interface.d.ts +16 -16
  24. package/lib/src/search-handler/search-backends/full-text-search-backend/full-text-search-service-interface.js +1 -1
  25. package/lib/src/search-handler/search-backends/local-search-backend/local-search-backend.d.ts +27 -27
  26. package/lib/src/search-handler/search-backends/local-search-backend/local-search-backend.js +42 -42
  27. package/lib/src/search-handler/search-backends/search-backend-interface.d.ts +9 -9
  28. package/lib/src/search-handler/search-backends/search-backend-interface.js +1 -1
  29. package/lib/src/search-handler/search-handler-interface.d.ts +17 -17
  30. package/lib/src/search-handler/search-handler-interface.js +1 -1
  31. package/lib/src/search-handler/search-handler.d.ts +83 -83
  32. package/lib/src/search-handler/search-handler.js +177 -177
  33. package/lib/src/search-handler/search-helper.d.ts +12 -12
  34. package/lib/src/search-handler/search-helper.js +22 -22
  35. package/lib/src/search-handler/search-models.d.ts +45 -45
  36. package/lib/src/search-handler/search-models.js +49 -49
  37. package/lib/src/search-handler/transcript-index-interface.d.ts +38 -38
  38. package/lib/src/search-handler/transcript-index-interface.js +1 -1
  39. package/lib/src/search-handler/transcript-index.d.ts +53 -53
  40. package/lib/src/search-handler/transcript-index.js +80 -80
  41. package/lib/src/search-results-switcher.d.ts +58 -58
  42. package/lib/src/search-results-switcher.js +133 -133
  43. package/package.json +93 -93
  44. package/src/assets/img/left.ts +17 -17
  45. package/src/assets/img/right.ts +17 -17
  46. package/src/models/music-zone.ts +17 -17
  47. package/src/models/radio-player-config.ts +47 -47
  48. package/src/radio-player.ts +1402 -1402
  49. package/src/search-handler/search-backends/full-text-search-backend/full-text-search-backend.ts +140 -140
  50. package/src/search-handler/search-backends/full-text-search-backend/full-text-search-response.ts +110 -110
  51. package/src/search-handler/search-backends/full-text-search-backend/full-text-search-service-interface.ts +17 -17
  52. package/src/search-handler/search-backends/local-search-backend/local-search-backend.ts +50 -50
  53. package/src/search-handler/search-backends/search-backend-interface.ts +10 -10
  54. package/src/search-handler/search-handler-interface.ts +18 -18
  55. package/src/search-handler/search-handler.ts +217 -217
  56. package/src/search-handler/search-helper.ts +25 -25
  57. package/src/search-handler/search-models.ts +69 -69
  58. package/src/search-handler/transcript-index-interface.ts +42 -42
  59. package/src/search-handler/transcript-index.ts +93 -93
  60. package/src/search-results-switcher.ts +131 -131
@@ -1,589 +1,589 @@
1
- import { LitElement, CSSResult, TemplateResult, PropertyValues } from 'lit';
2
- import { TranscriptConfig } from '@internetarchive/transcript-view';
3
- import '@internetarchive/waveform-progress';
4
- import '@internetarchive/playback-controls';
5
- import '@internetarchive/scrubber-bar';
6
- import '@internetarchive/expandable-search-bar';
7
- import '@internetarchive/ia-activity-indicator/ia-activity-indicator';
8
- import './search-results-switcher';
9
- import RadioPlayerConfig from './models/radio-player-config';
10
- import { SearchHandlerInterface } from './search-handler/search-handler-interface';
11
- /**
12
- * A Radio Player element to play back transcribed audio.
13
- *
14
- * It is responsible for orchestrating all of the other components like:
15
- * - Waveform Progress
16
- * - Scrubber Bar
17
- * - Playback Controls
18
- * - Transcript View
19
- * - Audio Element
20
- * - Search Bar
21
- *
22
- * @export
23
- * @class RadioPlayer
24
- * @extends {LitElement}
25
- */
26
- export default class RadioPlayer extends LitElement {
27
- /**
28
- * Radio player configuration
29
- *
30
- * @type {(RadioPlayerConfig | undefined)}
31
- * @memberof RadioPlayer
32
- */
33
- config: RadioPlayerConfig | undefined;
34
- /**
35
- * The Search Handler
36
- *
37
- * @type {(SearchHandlerInterface | undefined)}
38
- * @memberof RadioPlayer
39
- */
40
- searchHandler: SearchHandlerInterface | undefined;
41
- /**
42
- * Transcript configuration
43
- *
44
- * @type {(TranscriptConfig | undefined)}
45
- * @memberof RadioPlayer
46
- */
47
- transcriptConfig: TranscriptConfig | undefined;
48
- /**
49
- * Search result transcript. It's also a `TranscriptConfig` object, but is broken up by
50
- * transcript entries as well as search results.
51
- *
52
- * If this is set, the transcript view, uses this, otherwise it uses `transcriptConfig`
53
- *
54
- * @type {(TranscriptConfig | undefined)}
55
- * @memberof RadioPlayer
56
- */
57
- searchResultsTranscript: TranscriptConfig | undefined;
58
- /**
59
- * Current playback time
60
- *
61
- * @type {number}
62
- * @memberof RadioPlayer
63
- */
64
- currentTime: number;
65
- /**
66
- * Current search term
67
- *
68
- * @type {string}
69
- * @memberof RadioPlayer
70
- */
71
- searchTerm: string;
72
- /**
73
- * Flag to determine whether or not to skip the music sections
74
- *
75
- * @type {boolean}
76
- * @memberof RadioPlayer
77
- */
78
- skipMusicSections: boolean;
79
- /**
80
- * Percent of playback that is complete
81
- *
82
- * @private
83
- * @type {number}
84
- * @memberof RadioPlayer
85
- */
86
- private percentComplete;
87
- /**
88
- * Flag for whether or not the radio player is playing
89
- *
90
- * @private
91
- * @type {boolean}
92
- * @memberof RadioPlayer
93
- */
94
- private isPlaying;
95
- /**
96
- * Duration of the audio file
97
- *
98
- * @private
99
- * @type {number}
100
- * @memberof RadioPlayer
101
- */
102
- private duration;
103
- /**
104
- * The playback rate where 1 is "normal", 0 is paused, 2 is twice as fase
105
- *
106
- * @private
107
- * @type {number}
108
- * @memberof RadioPlayer
109
- */
110
- private playbackRate;
111
- /**
112
- * Volume from 0 to 1
113
- *
114
- * @private
115
- * @type {number}
116
- * @memberof RadioPlayer
117
- */
118
- private volume;
119
- /**
120
- * Flag for whether we should show the search results switcher
121
- *
122
- * @private
123
- * @type {boolean}
124
- * @memberof RadioPlayer
125
- */
126
- private shouldShowSearchResultSwitcher;
127
- /**
128
- * Flag for whether we should show the 'no results' message
129
- *
130
- * @private
131
- * @type {boolean}
132
- * @memberof RadioPlayer
133
- */
134
- private shouldShowNoSearchResultMessage;
135
- /**
136
- * Are we searching or not?
137
- *
138
- * @private
139
- * @type {boolean}
140
- * @memberof RadioPlayer
141
- */
142
- private isSearching;
143
- private musicZones;
144
- /**
145
- * LitElement lifecycle main render method
146
- *
147
- * @returns {TemplateResult}
148
- * @memberof RadioPlayer
149
- */
150
- render(): TemplateResult;
151
- /**
152
- * Start playback
153
- *
154
- * @memberof RadioPlayer
155
- */
156
- play(): void;
157
- /**
158
- * Pause playback
159
- *
160
- * @memberof RadioPlayer
161
- */
162
- pause(): void;
163
- /**
164
- * Seek audio to given number of seconds
165
- *
166
- * @param {number} seconds
167
- * @memberof RadioPlayer
168
- */
169
- seekTo(seconds: number): void;
170
- /**
171
- * Generate markup for the title and date view sections
172
- *
173
- * @readonly
174
- * @private
175
- * @type {TemplateResult}
176
- * @memberof RadioPlayer
177
- */
178
- private get titleDateTemplate();
179
- /**
180
- * Generate markup for the logo element
181
- *
182
- * @readonly
183
- * @private
184
- * @type {TemplateResult}
185
- * @memberof RadioPlayer
186
- */
187
- private get collectionLogoTemplate();
188
- /**
189
- * Return the logoUrl from the config if provided
190
- *
191
- * @readonly
192
- * @private
193
- * @type {string}
194
- * @memberof RadioPlayer
195
- */
196
- private get logoUrl();
197
- /**
198
- * Generate the markup for the waveform progress element
199
- *
200
- * @readonly
201
- * @private
202
- * @type {TemplateResult}
203
- * @memberof RadioPlayer
204
- */
205
- private get waveFormProgressTemplate();
206
- /**
207
- * Generate an array of `ZoneOfSilence` models for the waveform progress element
208
- *
209
- * It does this by parsing the transcript for music sections and converting
210
- * those music sections to zones of silence.
211
- *
212
- * @readonly
213
- * @private
214
- * @type {ZoneOfSilence[]}
215
- * @memberof RadioPlayer
216
- */
217
- private get zonesOfSilence();
218
- /**
219
- * Return the waveform url from the configuration
220
- *
221
- * @readonly
222
- * @private
223
- * @type {string}
224
- * @memberof RadioPlayer
225
- */
226
- private get waveformUrl();
227
- /**
228
- * Generate the audio element markup
229
- *
230
- * @readonly
231
- * @private
232
- * @type {TemplateResult}
233
- * @memberof RadioPlayer
234
- */
235
- private get audioElementTemplate();
236
- /**
237
- * Return the audio sources from the configuration
238
- *
239
- * @readonly
240
- * @private
241
- * @type {AudioSource[]}
242
- * @memberof RadioPlayer
243
- */
244
- private get audioSources();
245
- /**
246
- * Generate markup for the playback controls
247
- *
248
- * @readonly
249
- * @private
250
- * @type {TemplateResult}
251
- * @memberof RadioPlayer
252
- */
253
- private get playbackControlsTemplate();
254
- /**
255
- * Generate an array of start and end points for each of the music zones.
256
- * This allows us to show the markers on the scrubber bar and optionally skip those sections.
257
- *
258
- * @readonly
259
- * @private
260
- * @type {number[]}
261
- * @memberof RadioPlayer
262
- */
263
- private get scrubberBarMarkerPercentages();
264
- /**
265
- * Generate markup for the scrubber bar
266
- *
267
- * @readonly
268
- * @private
269
- * @type {TemplateResult}
270
- * @memberof RadioPlayer
271
- */
272
- private get scrubberBarTemplate();
273
- /**
274
- * Generate markup for the transcript view
275
- *
276
- * @readonly
277
- * @private
278
- * @type {TemplateResult}
279
- * @memberof RadioPlayer
280
- */
281
- private get transcriptViewTemplate();
282
- private get currentTranscript();
283
- /**
284
- * Generate markup for search section
285
- *
286
- * @readonly
287
- * @private
288
- * @type {TemplateResult}
289
- * @memberof RadioPlayer
290
- */
291
- private get searchSectionTemplate();
292
- /**
293
- * Generate markup for the search results switcher
294
- *
295
- * @readonly
296
- * @private
297
- * @type {TemplateResult}
298
- * @memberof RadioPlayer
299
- */
300
- private get searchResultsSwitcherTemplate();
301
- /**
302
- * Search activity indicator template
303
- *
304
- * @readonly
305
- * @private
306
- * @type {TemplateResult}
307
- * @memberof RadioPlayer
308
- */
309
- private get searchActivityIndicator();
310
- /**
311
- * Generate markup for the "No Search Results" message
312
- *
313
- * @readonly
314
- * @private
315
- * @type {TemplateResult}
316
- * @memberof RadioPlayer
317
- */
318
- private get noSearchResultsTemplate();
319
- /**
320
- * Generate an array of `QuickSearchEntry` objects based on the quick search
321
- * configuration passed in.
322
- *
323
- * @readonly
324
- * @private
325
- * @type {QuickSearchEntry[]}
326
- * @memberof RadioPlayer
327
- */
328
- private get quickSearches();
329
- /**
330
- * Update the local search term when the SearchBar widget gets updated and emits the event
331
- *
332
- * @private
333
- * @param {CustomEvent} e
334
- * @returns {void}
335
- * @memberof RadioPlayer
336
- */
337
- private updateSearchTerm;
338
- /**
339
- * Triggered when the user clicks the clear search button in the search bar.
340
- * Clean up all of the search info and reset to the base transcript.
341
- *
342
- * @private
343
- * @memberof RadioPlayer
344
- */
345
- private searchCleared;
346
- /**
347
- * Triggered when the user scrubs through search result indices so we can coordinate
348
- * the UI updates like scrolling the transcript view
349
- *
350
- * @private
351
- * @param {CustomEvent} e
352
- * @returns {void}
353
- * @memberof RadioPlayer
354
- */
355
- private searchResultIndexChanged;
356
- /**
357
- * Triggered when the user presses enter in the search bar so we can trigger a search.
358
- *
359
- * @private
360
- * @param {CustomEvent} e
361
- * @memberof RadioPlayer
362
- */
363
- private searchEnterKeyPressed;
364
- private executeSearch;
365
- /**
366
- * Return transcript entries from the transcript configuration
367
- *
368
- * @readonly
369
- * @private
370
- * @type {TranscriptEntryConfig[]}
371
- * @memberof RadioPlayer
372
- */
373
- private get transcriptEntries();
374
- /**
375
- * Return the transcript view DOM element
376
- *
377
- * @readonly
378
- * @private
379
- * @type {(TranscriptView | null)}
380
- * @memberof RadioPlayer
381
- */
382
- private get transcriptView();
383
- /**
384
- * Return the audio element DOM element
385
- *
386
- * @readonly
387
- * @private
388
- * @type {(AudioElement | null)}
389
- * @memberof RadioPlayer
390
- */
391
- private get audioElement();
392
- /**
393
- * Return the playback controls DOM element
394
- *
395
- * @readonly
396
- * @private
397
- * @type {(PlaybackControls | null)}
398
- * @memberof RadioPlayer
399
- */
400
- private get playbackControls();
401
- /**
402
- * Return the search results switcher DOM element
403
- *
404
- * @readonly
405
- * @private
406
- * @type {(SearchResultsSwitcher | null)}
407
- * @memberof RadioPlayer
408
- */
409
- private get searchResultsSwitcher();
410
- /**
411
- * Triggered when the user changes the playback rate so we can update the audio element
412
- *
413
- * @private
414
- * @param {CustomEvent} e
415
- * @returns {void}
416
- * @memberof RadioPlayer
417
- */
418
- private changePlaybackRate;
419
- /**
420
- * Triggered when the user changes the volume from the playback controls
421
- *
422
- * @private
423
- * @param {CustomEvent} e
424
- * @returns {void}
425
- * @memberof RadioPlayer
426
- */
427
- private volumeChanged;
428
- /**
429
- * Triggered when the user presses the back button in the playback controls
430
- *
431
- * @private
432
- * @memberof RadioPlayer
433
- */
434
- private backButtonHandler;
435
- /**
436
- * Triggered when the user presses the play/pause button
437
- *
438
- * @private
439
- * @returns {void}
440
- * @memberof RadioPlayer
441
- */
442
- private playPauseButtonHandler;
443
- /**
444
- * Triggered when the user presses the forward button in the playback controls
445
- *
446
- * @private
447
- * @memberof RadioPlayer
448
- */
449
- private forwardButtonHandler;
450
- /**
451
- * Skip to the next section
452
- *
453
- * @private
454
- * @returns {void}
455
- * @memberof RadioPlayer
456
- */
457
- private nextSectionButtonHandler;
458
- /**
459
- * Jump to the previous section
460
- *
461
- * @private
462
- * @returns {void}
463
- * @memberof RadioPlayer
464
- */
465
- private prevSectionButtonHandler;
466
- /**
467
- * Handle the duration change event like when the audio file first loads
468
- *
469
- * @private
470
- * @param {CustomEvent} e
471
- * @returns {void}
472
- * @memberof RadioPlayer
473
- */
474
- private handleDurationChange;
475
- /**
476
- * Triggered as the playback progresses in the audio element
477
- *
478
- * @private
479
- * @param {CustomEvent} e
480
- * @returns {void}
481
- * @memberof RadioPlayer
482
- */
483
- private handleTimeChange;
484
- /**
485
- * Update any consumers that the current time has changed
486
- *
487
- * @private
488
- * @memberof RadioPlayer
489
- */
490
- private emitCurrentTimeChangedEvent;
491
- /**
492
- * When the user clears the search, we want to bubble up the event to other consumers.
493
- *
494
- * @private
495
- * @memberof RadioPlayer
496
- */
497
- private emitSearchClearedEvent;
498
- private emitSearchTermChangedEvent;
499
- /**
500
- * Handle the playback paused event
501
- *
502
- * @private
503
- * @memberof RadioPlayer
504
- */
505
- private playbackPaused;
506
- /**
507
- * Handle the playback started event
508
- *
509
- * @private
510
- * @memberof RadioPlayer
511
- */
512
- private playbackStarted;
513
- /**
514
- * Emits a `canplay` event when the media is ready to be played
515
- *
516
- * @private
517
- * @memberof RadioPlayer
518
- */
519
- private canplay;
520
- /**
521
- * Triggered when the user scrubs the scrubber bar or waveform progress bar
522
- *
523
- * Handles updating the audioElement to the new time and emitting an event
524
- * that the time changed
525
- *
526
- * @private
527
- * @param {CustomEvent} e
528
- * @returns {void}
529
- * @memberof RadioPlayer
530
- */
531
- private valueChangedFromScrub;
532
- /**
533
- * Triggered when the user selects a transcript entry.
534
- * Allows it to jump to that spot in the playback.
535
- *
536
- * @private
537
- * @param {CustomEvent} e
538
- * @returns {void}
539
- * @memberof RadioPlayer
540
- */
541
- private transcriptEntrySelected;
542
- /**
543
- * Creates the music zones based on the transcript so we know when to skip past sections
544
- *
545
- * @private
546
- * @memberof RadioPlayer
547
- */
548
- private updateMusicZones;
549
- /**
550
- * Skips a music zone if enabled
551
- *
552
- * @private
553
- * @memberof RadioPlayer
554
- */
555
- private skipMusicZone;
556
- /**
557
- * Updates the search results switcher numbers
558
- *
559
- * @private
560
- * @returns {void}
561
- * @memberof RadioPlayer
562
- */
563
- private updateSearchResultSwitcher;
564
- /**
565
- * Returns the search result template entries from the transcript config
566
- *
567
- * @readonly
568
- * @private
569
- * @type {TranscriptEntryConfig[]}
570
- * @memberof RadioPlayer
571
- */
572
- private get searchResults();
573
- /**
574
- * LitElement life cycle event when any reactive property gets updated
575
- *
576
- * @param {PropertyValues} changedProperties
577
- * @memberof RadioPlayer
578
- */
579
- updated(changedProperties: PropertyValues): void;
580
- /**
581
- * Component styles
582
- *
583
- * @readonly
584
- * @static
585
- * @type {CSSResult}
586
- * @memberof RadioPlayer
587
- */
588
- static get styles(): CSSResult;
589
- }
1
+ import { LitElement, CSSResult, TemplateResult, PropertyValues } from 'lit';
2
+ import { TranscriptConfig } from '@internetarchive/transcript-view';
3
+ import '@internetarchive/waveform-progress';
4
+ import '@internetarchive/playback-controls';
5
+ import '@internetarchive/scrubber-bar';
6
+ import '@internetarchive/expandable-search-bar';
7
+ import '@internetarchive/ia-activity-indicator/ia-activity-indicator';
8
+ import './search-results-switcher';
9
+ import RadioPlayerConfig from './models/radio-player-config';
10
+ import { SearchHandlerInterface } from './search-handler/search-handler-interface';
11
+ /**
12
+ * A Radio Player element to play back transcribed audio.
13
+ *
14
+ * It is responsible for orchestrating all of the other components like:
15
+ * - Waveform Progress
16
+ * - Scrubber Bar
17
+ * - Playback Controls
18
+ * - Transcript View
19
+ * - Audio Element
20
+ * - Search Bar
21
+ *
22
+ * @export
23
+ * @class RadioPlayer
24
+ * @extends {LitElement}
25
+ */
26
+ export default class RadioPlayer extends LitElement {
27
+ /**
28
+ * Radio player configuration
29
+ *
30
+ * @type {(RadioPlayerConfig | undefined)}
31
+ * @memberof RadioPlayer
32
+ */
33
+ config: RadioPlayerConfig | undefined;
34
+ /**
35
+ * The Search Handler
36
+ *
37
+ * @type {(SearchHandlerInterface | undefined)}
38
+ * @memberof RadioPlayer
39
+ */
40
+ searchHandler: SearchHandlerInterface | undefined;
41
+ /**
42
+ * Transcript configuration
43
+ *
44
+ * @type {(TranscriptConfig | undefined)}
45
+ * @memberof RadioPlayer
46
+ */
47
+ transcriptConfig: TranscriptConfig | undefined;
48
+ /**
49
+ * Search result transcript. It's also a `TranscriptConfig` object, but is broken up by
50
+ * transcript entries as well as search results.
51
+ *
52
+ * If this is set, the transcript view, uses this, otherwise it uses `transcriptConfig`
53
+ *
54
+ * @type {(TranscriptConfig | undefined)}
55
+ * @memberof RadioPlayer
56
+ */
57
+ searchResultsTranscript: TranscriptConfig | undefined;
58
+ /**
59
+ * Current playback time
60
+ *
61
+ * @type {number}
62
+ * @memberof RadioPlayer
63
+ */
64
+ currentTime: number;
65
+ /**
66
+ * Current search term
67
+ *
68
+ * @type {string}
69
+ * @memberof RadioPlayer
70
+ */
71
+ searchTerm: string;
72
+ /**
73
+ * Flag to determine whether or not to skip the music sections
74
+ *
75
+ * @type {boolean}
76
+ * @memberof RadioPlayer
77
+ */
78
+ skipMusicSections: boolean;
79
+ /**
80
+ * Percent of playback that is complete
81
+ *
82
+ * @private
83
+ * @type {number}
84
+ * @memberof RadioPlayer
85
+ */
86
+ private percentComplete;
87
+ /**
88
+ * Flag for whether or not the radio player is playing
89
+ *
90
+ * @private
91
+ * @type {boolean}
92
+ * @memberof RadioPlayer
93
+ */
94
+ private isPlaying;
95
+ /**
96
+ * Duration of the audio file
97
+ *
98
+ * @private
99
+ * @type {number}
100
+ * @memberof RadioPlayer
101
+ */
102
+ private duration;
103
+ /**
104
+ * The playback rate where 1 is "normal", 0 is paused, 2 is twice as fase
105
+ *
106
+ * @private
107
+ * @type {number}
108
+ * @memberof RadioPlayer
109
+ */
110
+ private playbackRate;
111
+ /**
112
+ * Volume from 0 to 1
113
+ *
114
+ * @private
115
+ * @type {number}
116
+ * @memberof RadioPlayer
117
+ */
118
+ private volume;
119
+ /**
120
+ * Flag for whether we should show the search results switcher
121
+ *
122
+ * @private
123
+ * @type {boolean}
124
+ * @memberof RadioPlayer
125
+ */
126
+ private shouldShowSearchResultSwitcher;
127
+ /**
128
+ * Flag for whether we should show the 'no results' message
129
+ *
130
+ * @private
131
+ * @type {boolean}
132
+ * @memberof RadioPlayer
133
+ */
134
+ private shouldShowNoSearchResultMessage;
135
+ /**
136
+ * Are we searching or not?
137
+ *
138
+ * @private
139
+ * @type {boolean}
140
+ * @memberof RadioPlayer
141
+ */
142
+ private isSearching;
143
+ private musicZones;
144
+ /**
145
+ * LitElement lifecycle main render method
146
+ *
147
+ * @returns {TemplateResult}
148
+ * @memberof RadioPlayer
149
+ */
150
+ render(): TemplateResult;
151
+ /**
152
+ * Start playback
153
+ *
154
+ * @memberof RadioPlayer
155
+ */
156
+ play(): void;
157
+ /**
158
+ * Pause playback
159
+ *
160
+ * @memberof RadioPlayer
161
+ */
162
+ pause(): void;
163
+ /**
164
+ * Seek audio to given number of seconds
165
+ *
166
+ * @param {number} seconds
167
+ * @memberof RadioPlayer
168
+ */
169
+ seekTo(seconds: number): void;
170
+ /**
171
+ * Generate markup for the title and date view sections
172
+ *
173
+ * @readonly
174
+ * @private
175
+ * @type {TemplateResult}
176
+ * @memberof RadioPlayer
177
+ */
178
+ private get titleDateTemplate();
179
+ /**
180
+ * Generate markup for the logo element
181
+ *
182
+ * @readonly
183
+ * @private
184
+ * @type {TemplateResult}
185
+ * @memberof RadioPlayer
186
+ */
187
+ private get collectionLogoTemplate();
188
+ /**
189
+ * Return the logoUrl from the config if provided
190
+ *
191
+ * @readonly
192
+ * @private
193
+ * @type {string}
194
+ * @memberof RadioPlayer
195
+ */
196
+ private get logoUrl();
197
+ /**
198
+ * Generate the markup for the waveform progress element
199
+ *
200
+ * @readonly
201
+ * @private
202
+ * @type {TemplateResult}
203
+ * @memberof RadioPlayer
204
+ */
205
+ private get waveFormProgressTemplate();
206
+ /**
207
+ * Generate an array of `ZoneOfSilence` models for the waveform progress element
208
+ *
209
+ * It does this by parsing the transcript for music sections and converting
210
+ * those music sections to zones of silence.
211
+ *
212
+ * @readonly
213
+ * @private
214
+ * @type {ZoneOfSilence[]}
215
+ * @memberof RadioPlayer
216
+ */
217
+ private get zonesOfSilence();
218
+ /**
219
+ * Return the waveform url from the configuration
220
+ *
221
+ * @readonly
222
+ * @private
223
+ * @type {string}
224
+ * @memberof RadioPlayer
225
+ */
226
+ private get waveformUrl();
227
+ /**
228
+ * Generate the audio element markup
229
+ *
230
+ * @readonly
231
+ * @private
232
+ * @type {TemplateResult}
233
+ * @memberof RadioPlayer
234
+ */
235
+ private get audioElementTemplate();
236
+ /**
237
+ * Return the audio sources from the configuration
238
+ *
239
+ * @readonly
240
+ * @private
241
+ * @type {AudioSource[]}
242
+ * @memberof RadioPlayer
243
+ */
244
+ private get audioSources();
245
+ /**
246
+ * Generate markup for the playback controls
247
+ *
248
+ * @readonly
249
+ * @private
250
+ * @type {TemplateResult}
251
+ * @memberof RadioPlayer
252
+ */
253
+ private get playbackControlsTemplate();
254
+ /**
255
+ * Generate an array of start and end points for each of the music zones.
256
+ * This allows us to show the markers on the scrubber bar and optionally skip those sections.
257
+ *
258
+ * @readonly
259
+ * @private
260
+ * @type {number[]}
261
+ * @memberof RadioPlayer
262
+ */
263
+ private get scrubberBarMarkerPercentages();
264
+ /**
265
+ * Generate markup for the scrubber bar
266
+ *
267
+ * @readonly
268
+ * @private
269
+ * @type {TemplateResult}
270
+ * @memberof RadioPlayer
271
+ */
272
+ private get scrubberBarTemplate();
273
+ /**
274
+ * Generate markup for the transcript view
275
+ *
276
+ * @readonly
277
+ * @private
278
+ * @type {TemplateResult}
279
+ * @memberof RadioPlayer
280
+ */
281
+ private get transcriptViewTemplate();
282
+ private get currentTranscript();
283
+ /**
284
+ * Generate markup for search section
285
+ *
286
+ * @readonly
287
+ * @private
288
+ * @type {TemplateResult}
289
+ * @memberof RadioPlayer
290
+ */
291
+ private get searchSectionTemplate();
292
+ /**
293
+ * Generate markup for the search results switcher
294
+ *
295
+ * @readonly
296
+ * @private
297
+ * @type {TemplateResult}
298
+ * @memberof RadioPlayer
299
+ */
300
+ private get searchResultsSwitcherTemplate();
301
+ /**
302
+ * Search activity indicator template
303
+ *
304
+ * @readonly
305
+ * @private
306
+ * @type {TemplateResult}
307
+ * @memberof RadioPlayer
308
+ */
309
+ private get searchActivityIndicator();
310
+ /**
311
+ * Generate markup for the "No Search Results" message
312
+ *
313
+ * @readonly
314
+ * @private
315
+ * @type {TemplateResult}
316
+ * @memberof RadioPlayer
317
+ */
318
+ private get noSearchResultsTemplate();
319
+ /**
320
+ * Generate an array of `QuickSearchEntry` objects based on the quick search
321
+ * configuration passed in.
322
+ *
323
+ * @readonly
324
+ * @private
325
+ * @type {QuickSearchEntry[]}
326
+ * @memberof RadioPlayer
327
+ */
328
+ private get quickSearches();
329
+ /**
330
+ * Update the local search term when the SearchBar widget gets updated and emits the event
331
+ *
332
+ * @private
333
+ * @param {CustomEvent} e
334
+ * @returns {void}
335
+ * @memberof RadioPlayer
336
+ */
337
+ private updateSearchTerm;
338
+ /**
339
+ * Triggered when the user clicks the clear search button in the search bar.
340
+ * Clean up all of the search info and reset to the base transcript.
341
+ *
342
+ * @private
343
+ * @memberof RadioPlayer
344
+ */
345
+ private searchCleared;
346
+ /**
347
+ * Triggered when the user scrubs through search result indices so we can coordinate
348
+ * the UI updates like scrolling the transcript view
349
+ *
350
+ * @private
351
+ * @param {CustomEvent} e
352
+ * @returns {void}
353
+ * @memberof RadioPlayer
354
+ */
355
+ private searchResultIndexChanged;
356
+ /**
357
+ * Triggered when the user presses enter in the search bar so we can trigger a search.
358
+ *
359
+ * @private
360
+ * @param {CustomEvent} e
361
+ * @memberof RadioPlayer
362
+ */
363
+ private searchEnterKeyPressed;
364
+ private executeSearch;
365
+ /**
366
+ * Return transcript entries from the transcript configuration
367
+ *
368
+ * @readonly
369
+ * @private
370
+ * @type {TranscriptEntryConfig[]}
371
+ * @memberof RadioPlayer
372
+ */
373
+ private get transcriptEntries();
374
+ /**
375
+ * Return the transcript view DOM element
376
+ *
377
+ * @readonly
378
+ * @private
379
+ * @type {(TranscriptView | null)}
380
+ * @memberof RadioPlayer
381
+ */
382
+ private get transcriptView();
383
+ /**
384
+ * Return the audio element DOM element
385
+ *
386
+ * @readonly
387
+ * @private
388
+ * @type {(AudioElement | null)}
389
+ * @memberof RadioPlayer
390
+ */
391
+ private get audioElement();
392
+ /**
393
+ * Return the playback controls DOM element
394
+ *
395
+ * @readonly
396
+ * @private
397
+ * @type {(PlaybackControls | null)}
398
+ * @memberof RadioPlayer
399
+ */
400
+ private get playbackControls();
401
+ /**
402
+ * Return the search results switcher DOM element
403
+ *
404
+ * @readonly
405
+ * @private
406
+ * @type {(SearchResultsSwitcher | null)}
407
+ * @memberof RadioPlayer
408
+ */
409
+ private get searchResultsSwitcher();
410
+ /**
411
+ * Triggered when the user changes the playback rate so we can update the audio element
412
+ *
413
+ * @private
414
+ * @param {CustomEvent} e
415
+ * @returns {void}
416
+ * @memberof RadioPlayer
417
+ */
418
+ private changePlaybackRate;
419
+ /**
420
+ * Triggered when the user changes the volume from the playback controls
421
+ *
422
+ * @private
423
+ * @param {CustomEvent} e
424
+ * @returns {void}
425
+ * @memberof RadioPlayer
426
+ */
427
+ private volumeChanged;
428
+ /**
429
+ * Triggered when the user presses the back button in the playback controls
430
+ *
431
+ * @private
432
+ * @memberof RadioPlayer
433
+ */
434
+ private backButtonHandler;
435
+ /**
436
+ * Triggered when the user presses the play/pause button
437
+ *
438
+ * @private
439
+ * @returns {void}
440
+ * @memberof RadioPlayer
441
+ */
442
+ private playPauseButtonHandler;
443
+ /**
444
+ * Triggered when the user presses the forward button in the playback controls
445
+ *
446
+ * @private
447
+ * @memberof RadioPlayer
448
+ */
449
+ private forwardButtonHandler;
450
+ /**
451
+ * Skip to the next section
452
+ *
453
+ * @private
454
+ * @returns {void}
455
+ * @memberof RadioPlayer
456
+ */
457
+ private nextSectionButtonHandler;
458
+ /**
459
+ * Jump to the previous section
460
+ *
461
+ * @private
462
+ * @returns {void}
463
+ * @memberof RadioPlayer
464
+ */
465
+ private prevSectionButtonHandler;
466
+ /**
467
+ * Handle the duration change event like when the audio file first loads
468
+ *
469
+ * @private
470
+ * @param {CustomEvent} e
471
+ * @returns {void}
472
+ * @memberof RadioPlayer
473
+ */
474
+ private handleDurationChange;
475
+ /**
476
+ * Triggered as the playback progresses in the audio element
477
+ *
478
+ * @private
479
+ * @param {CustomEvent} e
480
+ * @returns {void}
481
+ * @memberof RadioPlayer
482
+ */
483
+ private handleTimeChange;
484
+ /**
485
+ * Update any consumers that the current time has changed
486
+ *
487
+ * @private
488
+ * @memberof RadioPlayer
489
+ */
490
+ private emitCurrentTimeChangedEvent;
491
+ /**
492
+ * When the user clears the search, we want to bubble up the event to other consumers.
493
+ *
494
+ * @private
495
+ * @memberof RadioPlayer
496
+ */
497
+ private emitSearchClearedEvent;
498
+ private emitSearchTermChangedEvent;
499
+ /**
500
+ * Handle the playback paused event
501
+ *
502
+ * @private
503
+ * @memberof RadioPlayer
504
+ */
505
+ private playbackPaused;
506
+ /**
507
+ * Handle the playback started event
508
+ *
509
+ * @private
510
+ * @memberof RadioPlayer
511
+ */
512
+ private playbackStarted;
513
+ /**
514
+ * Emits a `canplay` event when the media is ready to be played
515
+ *
516
+ * @private
517
+ * @memberof RadioPlayer
518
+ */
519
+ private canplay;
520
+ /**
521
+ * Triggered when the user scrubs the scrubber bar or waveform progress bar
522
+ *
523
+ * Handles updating the audioElement to the new time and emitting an event
524
+ * that the time changed
525
+ *
526
+ * @private
527
+ * @param {CustomEvent} e
528
+ * @returns {void}
529
+ * @memberof RadioPlayer
530
+ */
531
+ private valueChangedFromScrub;
532
+ /**
533
+ * Triggered when the user selects a transcript entry.
534
+ * Allows it to jump to that spot in the playback.
535
+ *
536
+ * @private
537
+ * @param {CustomEvent} e
538
+ * @returns {void}
539
+ * @memberof RadioPlayer
540
+ */
541
+ private transcriptEntrySelected;
542
+ /**
543
+ * Creates the music zones based on the transcript so we know when to skip past sections
544
+ *
545
+ * @private
546
+ * @memberof RadioPlayer
547
+ */
548
+ private updateMusicZones;
549
+ /**
550
+ * Skips a music zone if enabled
551
+ *
552
+ * @private
553
+ * @memberof RadioPlayer
554
+ */
555
+ private skipMusicZone;
556
+ /**
557
+ * Updates the search results switcher numbers
558
+ *
559
+ * @private
560
+ * @returns {void}
561
+ * @memberof RadioPlayer
562
+ */
563
+ private updateSearchResultSwitcher;
564
+ /**
565
+ * Returns the search result template entries from the transcript config
566
+ *
567
+ * @readonly
568
+ * @private
569
+ * @type {TranscriptEntryConfig[]}
570
+ * @memberof RadioPlayer
571
+ */
572
+ private get searchResults();
573
+ /**
574
+ * LitElement life cycle event when any reactive property gets updated
575
+ *
576
+ * @param {PropertyValues} changedProperties
577
+ * @memberof RadioPlayer
578
+ */
579
+ updated(changedProperties: PropertyValues): void;
580
+ /**
581
+ * Component styles
582
+ *
583
+ * @readonly
584
+ * @static
585
+ * @type {CSSResult}
586
+ * @memberof RadioPlayer
587
+ */
588
+ static get styles(): CSSResult;
589
+ }