Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ADA-6): v7 player (accessibility) - Frames for Video Players Aren't Labeled #787

Merged
merged 3 commits into from
Jul 1, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions src/player.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1968,6 +1968,7 @@ export default class Player extends FakeEventTarget {
this._eventManager.listen(this._engine, CustomEventType.DRM_LICENSE_LOADED, (event: FakeEvent) => this.dispatchEvent(event));
this._eventManager.listen(this._engine, CustomEventType.MANIFEST_LOADED, (event: FakeEvent) => this.dispatchEvent(event));
this._eventManager.listen(this._engine, CustomEventType.MEDIA_RECOVERED, () => this._handleRecovered());
this._eventManager.listen(this, CustomEventType.CHANGE_SOURCE_ENDED, () => this._addTitleOnIframe());
this._eventManager.listen(this, Html5EventType.PLAY, this._onPlay.bind(this));
this._eventManager.listen(this, Html5EventType.PAUSE, this._onPause.bind(this));
this._eventManager.listen(this, Html5EventType.PLAYING, this._onPlaying.bind(this));
Expand Down Expand Up @@ -2006,6 +2007,21 @@ export default class Player extends FakeEventTarget {
}
}

/**
* In iframe embed add title element with the entry name
* @returns {void}
* @private
*/
private _addTitleOnIframe(): void {
const head = Utils.Dom.getElementBySelector('head');
let title = head.querySelector('title');
if (!title){
title = Utils.Dom.createElement('title');
head.appendChild(title);
}
title.innerHTML = this._sources.metadata.name;
}

/**
* if the media was recovered (after a media failure) then initiate play again (if that was the state before)
* @returns {void}
Expand Down
Loading