@internetarchive/radio-player 0.0.3-a4 → 0.0.3

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 (34) hide show
  1. package/.eslintrc +37 -0
  2. package/.gitignore +11 -0
  3. package/.storybook/.babelrc +15 -0
  4. package/.storybook/addons.js +7 -0
  5. package/.storybook/config.js +11 -0
  6. package/.storybook/webpack.config.js +5 -0
  7. package/demo/full-text-search-service.ts +32 -0
  8. package/demo/index.html +53 -0
  9. package/demo/radio-player-controller.ts +237 -0
  10. package/karma.bs.config.js +16 -0
  11. package/karma.conf.js +66 -0
  12. package/package-lock.json +51719 -0
  13. package/package.json +5 -5
  14. package/stories/index.stories.js +40 -0
  15. package/stories/transcript.js +683 -0
  16. package/test/assets/arrow.mp3 +0 -0
  17. package/test/music-zone.test.js +13 -0
  18. package/test/promised-sleep.js +3 -0
  19. package/test/radio-player-config.test.js +42 -0
  20. package/test/radio-player.test.js +1072 -0
  21. package/test/sample_transcript.js +1493 -0
  22. package/test/search-handler/search-backends/full-text-sample-response-brackets.js +60 -0
  23. package/test/search-handler/search-backends/full-text-sample-response-em.js +60 -0
  24. package/test/search-handler/search-backends/full-text-search-backend.test.js +74 -0
  25. package/test/search-handler/search-backends/full-text-search-response.test.js +14 -0
  26. package/test/search-handler/search-backends/local-search-backend.test.js +39 -0
  27. package/test/search-handler/search-handler.test.js +550 -0
  28. package/test/search-handler/search-helper.test.js +63 -0
  29. package/test/search-handler/search-model.test.js +56 -0
  30. package/test/search-handler/transcript-index.test.js +66 -0
  31. package/test/search-results-switcher.test.js +97 -0
  32. package/tsconfig.build.json +7 -0
  33. package/tsconfig.json +21 -0
  34. package/yarn.lock +14450 -0
@@ -0,0 +1,683 @@
1
+ export default [
2
+ {
3
+ id: 1,
4
+ start: 4.058,
5
+ end: 6.032,
6
+ text: "Hello I'm Steve Miller U.S."
7
+ },
8
+ {
9
+ id: 2,
10
+ start: 6.033,
11
+ end: 10.029,
12
+ text: 'President Donald Trump blame'
13
+ },
14
+ {
15
+ id: 2,
16
+ start: 6.033,
17
+ end: 10.029,
18
+ search_match_index: 0,
19
+ text: 'Congress'
20
+ },
21
+ {
22
+ id: 2,
23
+ start: 6.033,
24
+ end: 10.029,
25
+ text: 'Thursday for creating new tensions with'
26
+ },
27
+ {
28
+ id: 3,
29
+ start: 10.03,
30
+ end: 14.093,
31
+ text: 'Russia by approving sanctions against Moscow and the Kremlin agreed that penalties'
32
+ },
33
+ {
34
+ id: 4,
35
+ start: 14.094,
36
+ end: 19.098,
37
+ text: 'would thwart improved relations and you pal cesky has more the president said that'
38
+ },
39
+ {
40
+ id: 5,
41
+ start: 19.099,
42
+ end: 20.037,
43
+ text: 'the U.S.'
44
+ },
45
+ {
46
+ id: 6,
47
+ start: 20.038,
48
+ end: 24.065,
49
+ text: 'Relationship with Russia is at an all time and very dangerous low and said quote'
50
+ },
51
+ {
52
+ id: 7,
53
+ start: 24.069,
54
+ end: 29.045,
55
+ text: 'You can think'
56
+ },
57
+ {
58
+ id: 7,
59
+ start: 24.069,
60
+ end: 29.045,
61
+ search_match_index: 1,
62
+ text: 'Congress'
63
+ },
64
+ {
65
+ id: 7,
66
+ start: 24.069,
67
+ end: 29.045,
68
+ search_match_index: 2,
69
+ text: 'Congress'
70
+ },
71
+ {
72
+ id: 7,
73
+ start: 24.069,
74
+ end: 29.045,
75
+ text: 'overwhelmingly voted for the sanctions and Trump'
76
+ },
77
+ {
78
+ id: 8,
79
+ start: 29.051,
80
+ end: 31.045,
81
+ text: 'unwilling to risk having lawmakers override'
82
+ },
83
+ {
84
+ id: 9,
85
+ start: 31.046,
86
+ end: 36.03,
87
+ text: 'a veto signed the legislation on Wednesday Russian Prime Minister Dmitry Medvedev'
88
+ },
89
+ {
90
+ id: 10,
91
+ start: 36.047,
92
+ end: 40.057,
93
+ text: 'said Trump signing of the package of new Russia sanctions ends hopes for improving'
94
+ },
95
+ {
96
+ id: 11,
97
+ start: 40.058,
98
+ end: 43.051,
99
+ text: 'our relations and repel cesky V.O.A.'
100
+ },
101
+ {
102
+ id: 12,
103
+ start: 43.052,
104
+ end: 48.052,
105
+ text: "News Venezuela's president has denied allegations that official turnout figures for"
106
+ },
107
+ {
108
+ id: 13,
109
+ start: 48.053,
110
+ end: 53.072,
111
+ text: 'the election of an all powerful constituent assembly were manipulated to peel away'
112
+ },
113
+ {
114
+ id: 14,
115
+ start: 53.077,
116
+ end: 58.074,
117
+ text: 'the president there might not be Nicolas Maduro accuse Smartmatic the international'
118
+ },
119
+ {
120
+ id: 15,
121
+ start: 58.075,
122
+ end: 61.085,
123
+ text: 'software firm behind the claim of bowing to U.S.'
124
+ },
125
+ {
126
+ id: 16,
127
+ start: 61.086,
128
+ end: 66.016,
129
+ text: 'Pressure but there are not only stood by the official count of eight million plus'
130
+ },
131
+ {
132
+ id: 17,
133
+ start: 66.017,
134
+ end: 70.063,
135
+ text: "votes cast in Sunday's divisive election but proclaimed that and then additional"
136
+ },
137
+ {
138
+ id: 18,
139
+ start: 70.064,
140
+ end: 74.049,
141
+ text: "two million people would have voted if they hadn't been blocked by anti-government"
142
+ },
143
+ {
144
+ id: 19,
145
+ start: 74.05,
146
+ end: 81.04,
147
+ text: 'protesters. A South African man held by al-Qaeda in Mali since two thousand and'
148
+ },
149
+ {
150
+ id: 20,
151
+ start: 81.041,
152
+ end: 87.04,
153
+ text: 'eleven has been freed the South African government said on Thursday Stephen McGowan'
154
+ },
155
+ {
156
+ id: 21,
157
+ start: 87.068,
158
+ end: 92.049,
159
+ text: 'was the last of three foreign nationals abducted in Timbuktu in November twenty'
160
+ },
161
+ {
162
+ id: 22,
163
+ start: 92.068,
164
+ end: 97.022,
165
+ text: 'seventh to be freed the governments of Mali and South Africa worked together along'
166
+ },
167
+ {
168
+ id: 23,
169
+ start: 97.023,
170
+ end: 101.098,
171
+ text: 'with the N.G.O.s gift of the givers to negotiate his release however the South'
172
+ },
173
+ {
174
+ id: 24,
175
+ start: 101.099,
176
+ end: 107.047,
177
+ text: 'African international relations minister said no ransom was paid for additional'
178
+ },
179
+ {
180
+ id: 25,
181
+ start: 107.048,
182
+ end: 111.07,
183
+ text: 'updates follow V.O.A. On social media platforms this is V.O.A.'
184
+ },
185
+ {
186
+ id: 26,
187
+ start: 111.071,
188
+ end: 117.055,
189
+ text: "News. Australian Prime Minister Malcolm Turnbull said the country's intelligence"
190
+ },
191
+ {
192
+ id: 27,
193
+ start: 117.059,
194
+ end: 122.072,
195
+ text: 'agency has downgraded the threat level to aviation after an alleged Islamic'
196
+ },
197
+ {
198
+ id: 28,
199
+ start: 122.073,
200
+ end: 124.043,
201
+ text: 'inspired plot to bring down'
202
+ },
203
+ {
204
+ id: 29,
205
+ start: 124.047,
206
+ end: 129.017,
207
+ text: 'a plane was uncovered commission of the federal place Commissioner Andrew Collins'
208
+ },
209
+ {
210
+ id: 30,
211
+ start: 129.018,
212
+ end: 132.047,
213
+ text: 'advised me that the investigation efforts are going'
214
+ },
215
+ {
216
+ id: 31,
217
+ start: 132.089,
218
+ end: 138.01,
219
+ text: 'a proceeding very successfully in terms of the gathering of evidence and that I'
220
+ },
221
+ {
222
+ id: 32,
223
+ start: 138.011,
224
+ end: 142.079,
225
+ text: 'should expect to strive and should expect charges to be light in due course but'
226
+ },
227
+ {
228
+ id: 33,
229
+ start: 142.08,
230
+ end: 143.063,
231
+ text: 'that is of course'
232
+ },
233
+ {
234
+ id: 34,
235
+ start: 144,
236
+ end: 148.076,
237
+ text: 'a matter for the place four men were arrested in raids in several suburbs of Sydney'
238
+ },
239
+ {
240
+ id: 35,
241
+ start: 148.077,
242
+ end: 153.073,
243
+ text: 'Australia is largest city at the weekend and held without charge under special'
244
+ },
245
+ {
246
+ id: 36,
247
+ start: 153.074,
248
+ end: 157.033,
249
+ text: 'terror related powers one man has since been released'
250
+ },
251
+ {
252
+ id: 37,
253
+ start: 157.058,
254
+ end: 162,
255
+ text: 'a US official familiar with the arrest told Reuters News Agency that the target'
256
+ },
257
+ {
258
+ id: 38,
259
+ start: 162.001,
260
+ end: 163.02,
261
+ text: 'appeared to have been'
262
+ },
263
+ {
264
+ id: 39,
265
+ start: 163.021,
266
+ end: 168.06,
267
+ text: "a commercial flight from Sydney to the Persian Gulf Pakistan's military chief there"
268
+ },
269
+ {
270
+ id: 40,
271
+ start: 168.061,
272
+ end: 170.049,
273
+ text: 'is a condemned as terrorism'
274
+ },
275
+ {
276
+ id: 41,
277
+ start: 170.05,
278
+ end: 175.004,
279
+ text: 'a Taliban attack in neighboring Afghanistan in which two U.S.'
280
+ },
281
+ {
282
+ id: 42,
283
+ start: 175.005,
284
+ end: 180.031,
285
+ text: 'Troops were killed and four others wounded via ways Robert riffle the remarks came'
286
+ },
287
+ {
288
+ id: 43,
289
+ start: 180.032,
290
+ end: 181.037,
291
+ text: 'on a day when the U.S.'
292
+ },
293
+ {
294
+ id: 44,
295
+ start: 181.038,
296
+ end: 184.041,
297
+ text: 'Special envoy for the region Alice Wells began'
298
+ },
299
+ {
300
+ id: 45,
301
+ start: 184.042,
302
+ end: 189.001,
303
+ text: 'a two day official visit to Islamabad to discuss ways to end the armed Afghan'
304
+ },
305
+ {
306
+ id: 46,
307
+ start: 189.002,
308
+ end: 194.011,
309
+ text: "conflict and other issues the Taliban swiftly took credit for Wednesday's attack in"
310
+ },
311
+ {
312
+ id: 47,
313
+ start: 194.012,
314
+ end: 198.054,
315
+ text: 'the southern Afghan city of Kandahar saying one of its suicide bombers drove its'
316
+ },
317
+ {
318
+ id: 48,
319
+ start: 198.055,
320
+ end: 200.096,
321
+ text: 'explosives packed car into the convoy'
322
+ },
323
+ {
324
+ id: 49,
325
+ start: 201.027,
326
+ end: 206.017,
327
+ text: 'a Taliban spokesman says fifteen soldiers belonging to quote foreign occupation'
328
+ },
329
+ {
330
+ id: 50,
331
+ start: 206.018,
332
+ end: 210.066,
333
+ text: 'forces including two high ranking officers were killed however the Taliban'
334
+ },
335
+ {
336
+ id: 51,
337
+ start: 210.067,
338
+ end: 216.064,
339
+ text: 'routinely exaggerates casualty figures when making such claims firefighters battled'
340
+ },
341
+ {
342
+ id: 52,
343
+ start: 216.065,
344
+ end: 220.018,
345
+ text: "a blaze in Tokyo's soup Keiji market it's"
346
+ },
347
+ {
348
+ id: 53,
349
+ start: 220.019,
350
+ end: 224.054,
351
+ text: 'a fish market as large and one of the most popular attractions in the city the fire'
352
+ },
353
+ {
354
+ id: 54,
355
+ start: 224.055,
356
+ end: 231.004,
357
+ text: 'broke out just after five pm local time Thursday Yoshi to Matsushita works at'
358
+ },
359
+ {
360
+ id: 55,
361
+ start: 231.008,
362
+ end: 236.07,
363
+ text: "a restaurant inside the market filling us. Locals it's tricky to fish market work"
364
+ },
365
+ {
366
+ id: 56,
367
+ start: 236.071,
368
+ end: 241.008,
369
+ text: 'really hard for their living we all know they attracted many customers and tourists'
370
+ },
371
+ {
372
+ id: 57,
373
+ start: 241.053,
374
+ end: 245.04,
375
+ text: "I'm worried about how they'll cope with this incident it must be hard for them with"
376
+ },
377
+ {
378
+ id: 58,
379
+ start: 245.041,
380
+ end: 251.045,
381
+ text: 'such severe damage. When the local the fire affected the so-called outer market'
382
+ },
383
+ {
384
+ id: 59,
385
+ start: 251.046,
386
+ end: 256.084,
387
+ text: 'where restaurants are located the inner market was not affected. And Israeli police'
388
+ },
389
+ {
390
+ id: 60,
391
+ start: 256.085,
392
+ end: 260.09,
393
+ text: 'document says Prime Minister Benjamin Netanyahu is suspected of crimes involving'
394
+ },
395
+ {
396
+ id: 61,
397
+ start: 260.091,
398
+ end: 265.013,
399
+ text: 'breach of trust and bribes into corruption cases the document released to media'
400
+ },
401
+ {
402
+ id: 62,
403
+ start: 265.014,
404
+ end: 270.007,
405
+ text: 'outlets says the cases involving Netanyahu deal with suspicion of bribes and breach'
406
+ },
407
+ {
408
+ id: 63,
409
+ start: 270.008,
410
+ end: 272.006,
411
+ text: 'of trust police have put'
412
+ },
413
+ {
414
+ id: 64,
415
+ start: 272.007,
416
+ end: 276.078,
417
+ text: 'a gag order on reporting any additional details Netanyahu denies wrong during'
418
+ },
419
+ {
420
+ id: 65,
421
+ start: 277.019,
422
+ end: 278.063,
423
+ text: 'portraying the accusation as'
424
+ },
425
+ {
426
+ id: 66,
427
+ start: 278.064,
428
+ end: 282.096,
429
+ text: 'a witch hunt against him and his family by hostile media opposed to his political'
430
+ },
431
+ {
432
+ id: 67,
433
+ start: 282.097,
434
+ end: 289.057,
435
+ text: "views I'm Steve Miller in Washington. That's the latest world news from B"
436
+ },
437
+ {
438
+ id: 68,
439
+ start: 289.062,
440
+ end: 290.048,
441
+ text: 'O A.'
442
+ },
443
+ {
444
+ id: 69,
445
+ start: 300.052,
446
+ end: 306.012,
447
+ text: "It is Thursday August third and this is the OAS international edition I'm Sara"
448
+ },
449
+ {
450
+ id: 70,
451
+ start: 306.013,
452
+ end: 310.07,
453
+ text: 'Williams in Washington coming up President Donald Trump and Moscow agree that'
454
+ },
455
+ {
456
+ id: 71,
457
+ start: 310.071,
458
+ end: 313.067,
459
+ text: 'relations between the United States and Russia are at'
460
+ },
461
+ {
462
+ id: 72,
463
+ start: 313.068,
464
+ end: 319.025,
465
+ text: "a low point following Washington's imposition of new sanctions from the reader and"
466
+ },
467
+ {
468
+ id: 73,
469
+ start: 319.026,
470
+ end: 324.037,
471
+ text: 'the'
472
+ },
473
+ {
474
+ id: 73,
475
+ start: 319.026,
476
+ end: 324.037,
477
+ search_match_index: 3,
478
+ text: 'Congress'
479
+ },
480
+ {
481
+ id: 73,
482
+ start: 319.026,
483
+ end: 324.037,
484
+ text: "bill which is now law it because they don't track on"
485
+ },
486
+ {
487
+ id: 74,
488
+ start: 324.038,
489
+ end: 329.083,
490
+ text: 'a Trump on Russia President Trump wants to change legal immigration to the U.S.'
491
+ },
492
+ {
493
+ id: 75,
494
+ start: 330.01,
495
+ end: 332.037,
496
+ text: 'And we hear why a classic story about'
497
+ },
498
+ {
499
+ id: 76,
500
+ start: 332.038,
501
+ end: 337.05,
502
+ text: "a little girl who lives in New York's Plaza Hotel continues to delight fans it's"
503
+ },
504
+ {
505
+ id: 77,
506
+ start: 337.051,
507
+ end: 342.026,
508
+ text: 'all ahead. Of U.S.'
509
+ },
510
+ {
511
+ id: 78,
512
+ start: 342.027,
513
+ end: 346.052,
514
+ text: 'President Donald Trump blame'
515
+ },
516
+ {
517
+ id: 78,
518
+ start: 342.027,
519
+ end: 346.052,
520
+ search_match_index: 4,
521
+ text: 'Congress'
522
+ },
523
+ {
524
+ id: 78,
525
+ start: 342.027,
526
+ end: 346.052,
527
+ text: 'Thursday for creating new tensions with'
528
+ },
529
+
530
+ {
531
+ id: 79,
532
+ start: 346.053,
533
+ end: 351.082,
534
+ text: 'Russia by approving sanctions against Moscow Tronto to Twitter to say our'
535
+ },
536
+ {
537
+ id: 80,
538
+ start: 351.083,
539
+ end: 357.041,
540
+ text: 'relationship with Russia is at an. All time and very dangerous low he said'
541
+ },
542
+ {
543
+ id: 80,
544
+ start: 351.083,
545
+ end: 357.041,
546
+ search_match_index: 5,
547
+ text: 'Congress'
548
+ },
549
+ {
550
+ id: 81,
551
+ start: 357.042,
552
+ end: 362.04,
553
+ text: 'was to blame and chastise members for failing to support his effort to dismantle'
554
+ },
555
+ {
556
+ id: 82,
557
+ start: 362.041,
558
+ end: 367.032,
559
+ text: "the country's health care law championed by his predecessor former President Barack"
560
+ },
561
+ {
562
+ id: 83,
563
+ start: 367.033,
564
+ end: 368.074,
565
+ text: 'Obama although'
566
+ },
567
+ {
568
+ id: 84,
569
+ start: 368.078,
570
+ end: 372.093,
571
+ text: 'a looker is the director of the Russia and Eurasia program at the Center for'
572
+ },
573
+ {
574
+ id: 85,
575
+ start: 372.094,
576
+ end: 377.07,
577
+ text: 'Strategic and International Studies I asked her for her opinion on the current'
578
+ },
579
+ {
580
+ id: 86,
581
+ start: 377.071,
582
+ end: 383.038,
583
+ text: 'relationship between Washington and Moscow but relationship is definitely at'
584
+ },
585
+ {
586
+ id: 87,
587
+ start: 383.043,
588
+ end: 389.063,
589
+ text: 'a low point I still think the Cuban Missile Crisis was worse. Though I suppose one'
590
+ },
591
+ {
592
+ id: 88,
593
+ start: 389.064,
594
+ end: 393.022,
595
+ text: 'could argue that with the Soviet Union that the post of the Russian Federation but'
596
+ },
597
+ {
598
+ id: 89,
599
+ start: 393.056,
600
+ end: 395.018,
601
+ text: 'now this is definitely'
602
+ },
603
+ {
604
+ id: 90,
605
+ start: 395.026,
606
+ end: 400.059,
607
+ text: 'a very very challenging point in the relationship between the two countries well in'
608
+ },
609
+ {
610
+ id: 91,
611
+ start: 400.06,
612
+ end: 405.021,
613
+ text: 'this situation you know'
614
+ },
615
+ {
616
+ id: 91,
617
+ start: 400.06,
618
+ end: 405.021,
619
+ search_match_index: 6,
620
+ text: 'Congress'
621
+ },
622
+ {
623
+ id: 91,
624
+ start: 400.06,
625
+ end: 405.021,
626
+ text: 'overwhelmingly voted for the sanctions and Trump'
627
+ },
628
+
629
+ {
630
+ id: 92,
631
+ start: 405.043,
632
+ end: 408.091,
633
+ text: 'he did not want to risk having lawmakers override'
634
+ },
635
+ {
636
+ id: 93,
637
+ start: 408.092,
638
+ end: 414.003,
639
+ text: 'a veto he went ahead and signed at but he certainly made his his displeasure with'
640
+ },
641
+ {
642
+ id: 94,
643
+ start: 414.004,
644
+ end: 420.065,
645
+ text: 'that very evident this comes as admitted his administration is being investigated'
646
+ },
647
+ {
648
+ id: 95,
649
+ start: 420.066,
650
+ end: 425.019,
651
+ text: 'for ties during his presidential campaign the Trump presidential campaign and two'
652
+ },
653
+ {
654
+ id: 96,
655
+ start: 425.02,
656
+ end: 428.099,
657
+ text: 'thousand and sixteen for ties to the Russians and then you know this also seems to'
658
+ },
659
+ {
660
+ id: 97,
661
+ start: 429,
662
+ end: 429.039,
663
+ text: 'add'
664
+ },
665
+ {
666
+ id: 98,
667
+ start: 429.04,
668
+ end: 435.045,
669
+ text: "a sort of another dimension that I don't know that we've quite seen in previous White"
670
+ },
671
+ {
672
+ id: 99,
673
+ start: 435.046,
674
+ end: 440.011,
675
+ text: 'Houses Yeah I think the allegations of collusion with the foreign governments are'
676
+ },
677
+ {
678
+ id: 100,
679
+ start: 440.034,
680
+ end: 445.02,
681
+ text: "comparatively new at least in most people's most people's memory Look the reason"
682
+ }
683
+ ];
Binary file
@@ -0,0 +1,13 @@
1
+ import {
2
+ html, fixture, expect, oneEvent, elementUpdated
3
+ } from '@open-wc/testing';
4
+
5
+ import MusicZone from '../lib/src/models/music-zone';
6
+
7
+ describe('Music Zone', () => {
8
+ it('can be instantiated', async () => {
9
+ const zone = new MusicZone(10, 20);
10
+ expect(zone.start).to.equal(10);
11
+ expect(zone.end).to.equal(20);
12
+ });
13
+ });
@@ -0,0 +1,3 @@
1
+ export default function promisedSleep(ms) {
2
+ return new Promise(resolve => setTimeout(resolve, ms));
3
+ }