1 import { buildPlaylistLink, buildVideoLink, buildVideoOrPlaylistEmbed } from 'src/assets/player/utils'
2 import { environment } from 'src/environments/environment'
3 import { Component, ElementRef, Input, OnInit } from '@angular/core'
6 selector: 'my-embed-markup',
9 export class EmbedMarkupComponent implements OnInit {
11 @Input() type: 'video' | 'playlist' = 'video'
13 constructor (private el: ElementRef) { }
16 const link = this.type === 'video'
17 ? buildVideoLink({ baseUrl: `${environment.originServerUrl}/videos/embed/${this.uuid}` })
18 : buildPlaylistLink({ baseUrl: `${environment.originServerUrl}/video-playlists/embed/${this.uuid}` })
20 this.el.nativeElement.innerHTML = buildVideoOrPlaylistEmbed(link, this.uuid)