mirror of
https://github.com/mediacms-io/mediacms.git
synced 2025-11-06 07:28:53 -05:00
fix: Check if this is an embed player, and open the links to a new tab
This commit is contained in:
parent
c7ad28572f
commit
4175a9d08f
@ -129,7 +129,21 @@ class EndScreenOverlay extends Component {
|
|||||||
|
|
||||||
// Add click handler
|
// Add click handler
|
||||||
item.addEventListener('click', () => {
|
item.addEventListener('click', () => {
|
||||||
window.location.href = `/view?m=${video.id}`;
|
// Check if this is an embed player - use multiple methods for reliability
|
||||||
|
const playerId = this.player().id() || this.player().options_.id;
|
||||||
|
const isEmbedPlayer =
|
||||||
|
playerId === 'video-embed' ||
|
||||||
|
window.location.pathname.includes('/embed') ||
|
||||||
|
window.location.search.includes('embed') ||
|
||||||
|
window.parent !== window; // Most reliable check for iframe
|
||||||
|
|
||||||
|
if (isEmbedPlayer) {
|
||||||
|
// Open in new tab/window for embed players
|
||||||
|
window.open(`/view?m=${video.id}`, '_blank', 'noopener,noreferrer');
|
||||||
|
} else {
|
||||||
|
// Navigate in same window for regular players
|
||||||
|
window.location.href = `/view?m=${video.id}`;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
return item;
|
return item;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user