ng-aparat-video
Version:
An Angular component for embedding Aparat videos
26 lines (22 loc) • 1.15 kB
text/typescript
import { Component, Input } from '@angular/core';
({
selector: 'ng-aparat-video',
templateUrl: './ng-aparat-video.component.html',
styleUrls: ['./ng-aparat-video.component.css'],
standalone:false
})
export class NgAparatVideoComponent {
() videoId!: string; // شناسه ویدیو
() useScriptEmbed: boolean = true; // انتخاب روش نمایش
() autoplay: boolean = true;
() muted: boolean = true;
() titleShow: boolean = true;
() startTime: number = 0;
() recom: string = "self"; // تنظیمات پیشنهاد ویدیو
get scriptEmbedUrl(): string {
return `https://www.aparat.com/embed/${this.videoId}?data[rnddiv]=${Date.now()}&data[responsive]=yes&muted=${this.muted}&titleShow=${this.titleShow}&startTime=${this.startTime}&autoplay=${this.autoplay}&recom=${this.recom}`;
}
get iframeEmbedUrl(): string {
return `https://www.aparat.com/video/video/embed/videohash/${this.videoId}/vt/frame?titleShow=${this.titleShow}&startTime=${this.startTime}&muted=${this.muted}&autoplay=${this.autoplay}&recom=${this.recom}`;
}
}