realisation de la page user/historique
This commit is contained in:
parent
d0ca04aefc
commit
e358b6fa0e
18 changed files with 370 additions and 28 deletions
|
|
@ -37,7 +37,7 @@ export class PageSearchComponent implements OnInit
|
|||
ngOnInit(): void
|
||||
{
|
||||
// --- FAUX CODE ---
|
||||
this.tabVideo = this.fictitiousDatasService.getTabVideo(11);
|
||||
this.tabVideo = this.fictitiousDatasService.getTabVideo(5);
|
||||
this.ad1 = this.fictitiousDatasService.getAdvert();
|
||||
this.ad2 = this.fictitiousDatasService.getAdvert();
|
||||
|
||||
|
|
@ -63,7 +63,7 @@ export class PageSearchComponent implements OnInit
|
|||
onSearch()
|
||||
{
|
||||
// --- FAUX CODE ---
|
||||
this.tabVideo = this.fictitiousDatasService.getTabVideo(4);
|
||||
this.tabVideo = this.fictitiousDatasService.getTabVideo(2);
|
||||
|
||||
// --- VRAI CODE ---
|
||||
/*
|
||||
|
|
@ -86,11 +86,4 @@ export class PageSearchComponent implements OnInit
|
|||
*/
|
||||
}
|
||||
|
||||
|
||||
tiles = [
|
||||
{text: 'One', cols: 2, rows: 1, color: 'lightblue'},
|
||||
{text: 'Two', cols: 7, rows: 1, color: 'lightgreen'},
|
||||
{text: 'Three', cols: 2, rows: 1, color: 'lightpink'},
|
||||
];
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
<div [class]="themeService.getClassTheme()">
|
||||
<div class="conteneur">
|
||||
<iframe appIframeTracker [src]=safeUrl allowfullscreen (iframeClick)="onIframeClick(this.video.url)"></iframe><br/>
|
||||
<iframe appIframeTracker [src]=safeUrl allowfullscreen (iframeClick)="onIframeClick()"></iframe><br/>
|
||||
<span>{{video.title}}</span>
|
||||
<button mat-icon-button (click)="onAdd()">
|
||||
<mat-icon > add_circle </mat-icon>
|
||||
|
|
|
|||
|
|
@ -7,20 +7,26 @@ import {VideoUrlService} from "../../../utils/services/videoUrl/video-url.servic
|
|||
import {AddVideoToPlaylistsService} from "../../../utils/services/addVideoToPlaylists/add-video-to-playlists.service";
|
||||
import {Video} from "../../../utils/interfaces/video";
|
||||
import {ThemeService} from "../../../utils/services/theme/theme.service";
|
||||
import {WatchedVideo} from "../../../utils/interfaces/watchedVideo";
|
||||
import {MessageService} from "../../../utils/services/message/message.service";
|
||||
import {HistoriqueService} from "../../../utils/services/historique/historique.service";
|
||||
|
||||
@Component({
|
||||
selector: 'app-video-cell',
|
||||
templateUrl: './video-cell.component.html',
|
||||
styleUrls: ['./video-cell.component.scss']
|
||||
selector: 'app-video-cell',
|
||||
templateUrl: './video-cell.component.html',
|
||||
styleUrls: ['./video-cell.component.scss']
|
||||
})
|
||||
export class VideoCellComponent implements OnInit
|
||||
{
|
||||
@Input() video: Video;
|
||||
safeUrl;
|
||||
tabVideoUrlClicked: string[] = [];
|
||||
|
||||
constructor( private videoUrlService: VideoUrlService,
|
||||
private addVideoToPlaylistsService: AddVideoToPlaylistsService,
|
||||
public themeService: ThemeService) {}
|
||||
public themeService: ThemeService,
|
||||
private messageService: MessageService,
|
||||
private historiqueService: HistoriqueService ) {}
|
||||
|
||||
ngOnInit(): void
|
||||
{
|
||||
|
|
@ -32,7 +38,10 @@ export class VideoCellComponent implements OnInit
|
|||
this.addVideoToPlaylistsService.run(this.video);
|
||||
}
|
||||
|
||||
onIframeClick(videoUrl: string) {
|
||||
console.log("test click iframe "+ videoUrl);
|
||||
}
|
||||
onIframeClick()
|
||||
{
|
||||
console.log("onIframeClick: " + this.video.title);
|
||||
this.historiqueService.addVideoToHistoque(this.video);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,8 +2,8 @@
|
|||
<nav>
|
||||
<ul>
|
||||
<li class="row ligne" *ngFor="let triplet of tabTriplet">
|
||||
<div class="col-4" *ngFor="let video0 of triplet">
|
||||
<app-video-cell [video]="video0"></app-video-cell>
|
||||
<div class="col-4" *ngFor="let video of triplet">
|
||||
<app-video-cell [video]="video"></app-video-cell>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,11 @@
|
|||
import {Component, Input, OnChanges, OnInit, SimpleChanges} from '@angular/core';
|
||||
import {Video} from "../../../utils/interfaces/video";
|
||||
import {VideoUrlService} from "../../../utils/services/videoUrl/video-url.service";
|
||||
import {AddVideoToPlaylistsService} from "../../../utils/services/addVideoToPlaylists/add-video-to-playlists.service";
|
||||
import {ThemeService} from "../../../utils/services/theme/theme.service";
|
||||
import {MessageService} from "../../../utils/services/message/message.service";
|
||||
import {WatchedVideo} from "../../../utils/interfaces/watchedVideo";
|
||||
import {HistoriqueService} from "../../../utils/services/historique/historique.service";
|
||||
|
||||
|
||||
@Component({
|
||||
|
|
@ -12,8 +18,14 @@ export class VideoGridComponent implements OnChanges
|
|||
@Input() tabVideo: Video[] = [];
|
||||
tabTriplet = [];
|
||||
|
||||
ngOnChanges(changes: SimpleChanges): void
|
||||
|
||||
constructor(private historiqueService: HistoriqueService) {}
|
||||
|
||||
|
||||
ngOnChanges(): void
|
||||
{
|
||||
this.historiqueService.clearTabVideoUrlClicked();
|
||||
|
||||
this.tabTriplet = [];
|
||||
let n = this.tabVideo.length;
|
||||
let i = 0;
|
||||
|
|
|
|||
Reference in a new issue