vidply 1.0.3 → 1.0.4
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.
- package/dist/vidply.css +24 -0
- package/dist/vidply.esm.js +217 -34
- package/dist/vidply.esm.js.map +2 -2
- package/dist/vidply.esm.min.js +7 -6
- package/dist/vidply.esm.min.meta.json +7 -7
- package/dist/vidply.js +217 -34
- package/dist/vidply.js.map +2 -2
- package/dist/vidply.min.css +1 -1
- package/dist/vidply.min.js +7 -6
- package/dist/vidply.min.meta.json +7 -7
- package/package.json +57 -54
- package/src/controls/ControlBar.js +2026 -1988
- package/src/core/Player.js +36 -0
- package/src/features/PlaylistManager.js +611 -437
- package/src/styles/vidply.css +24 -0
package/src/core/Player.js
CHANGED
|
@@ -515,6 +515,23 @@ export class Player extends EventEmitter {
|
|
|
515
515
|
this.captionManager.destroy();
|
|
516
516
|
this.captionManager = new CaptionManager(this);
|
|
517
517
|
}
|
|
518
|
+
|
|
519
|
+
// Reinitialize transcript manager to pick up new tracks
|
|
520
|
+
if (this.transcriptManager) {
|
|
521
|
+
const wasVisible = this.transcriptManager.isVisible;
|
|
522
|
+
this.transcriptManager.destroy();
|
|
523
|
+
this.transcriptManager = new TranscriptManager(this);
|
|
524
|
+
|
|
525
|
+
// Restore visibility state if transcript was open
|
|
526
|
+
if (wasVisible) {
|
|
527
|
+
this.transcriptManager.showTranscript();
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
// Update control bar to show/hide feature buttons based on new tracks
|
|
532
|
+
if (this.controlBar) {
|
|
533
|
+
this.updateControlBar();
|
|
534
|
+
}
|
|
518
535
|
|
|
519
536
|
this.emit('sourcechange', config);
|
|
520
537
|
this.log('Media loaded successfully');
|
|
@@ -529,6 +546,25 @@ export class Player extends EventEmitter {
|
|
|
529
546
|
* @param {string} src - New source URL
|
|
530
547
|
* @returns {boolean}
|
|
531
548
|
*/
|
|
549
|
+
/**
|
|
550
|
+
* Update control bar to refresh button visibility based on available features
|
|
551
|
+
*/
|
|
552
|
+
updateControlBar() {
|
|
553
|
+
if (!this.controlBar) return;
|
|
554
|
+
|
|
555
|
+
const controlBar = this.controlBar;
|
|
556
|
+
|
|
557
|
+
// Clear existing controls content
|
|
558
|
+
controlBar.element.innerHTML = '';
|
|
559
|
+
|
|
560
|
+
// Recreate controls with updated feature detection
|
|
561
|
+
controlBar.createControls();
|
|
562
|
+
|
|
563
|
+
// Reattach events for the new controls
|
|
564
|
+
controlBar.attachEvents();
|
|
565
|
+
controlBar.setupAutoHide();
|
|
566
|
+
}
|
|
567
|
+
|
|
532
568
|
shouldChangeRenderer(src) {
|
|
533
569
|
if (!this.renderer) return true;
|
|
534
570
|
|