From ca51704186f040bbd5dd23108740004d636edede Mon Sep 17 00:00:00 2001 From: Tzipi-kaltura Date: Mon, 24 Jun 2024 14:51:52 +0300 Subject: [PATCH] add iframe check --- src/player.ts | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/player.ts b/src/player.ts index a4744e5b..af42bea7 100644 --- a/src/player.ts +++ b/src/player.ts @@ -2013,13 +2013,15 @@ export default class Player extends FakeEventTarget { * @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); + if (window.self !== window.top) { + 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; } - title.innerHTML = this._sources.metadata.name; } /**