mirror of https://github.com/OpenVidu/openvidu.git
openvidu-components: Replaced poster image to letter color box
parent
e512dcc735
commit
d29f650b02
|
@ -0,0 +1,22 @@
|
||||||
|
.poster {
|
||||||
|
position: absolute;
|
||||||
|
display: inline-grid;
|
||||||
|
z-index: 1;
|
||||||
|
margin: auto;
|
||||||
|
bottom: 0;
|
||||||
|
right: 0;
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
height: 70px;
|
||||||
|
width: 70px;
|
||||||
|
border-radius: var(--ov-video-radius);
|
||||||
|
border: 2px solid var(--ov-light-color);
|
||||||
|
color: #000000;
|
||||||
|
}
|
||||||
|
|
||||||
|
#poster-text {
|
||||||
|
padding: 20px;
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 40px;
|
||||||
|
margin: auto;
|
||||||
|
}
|
|
@ -0,0 +1,25 @@
|
||||||
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { AvatarProfileComponent } from './avatar-profile.component';
|
||||||
|
|
||||||
|
describe('AvatarProfileComponent', () => {
|
||||||
|
let component: AvatarProfileComponent;
|
||||||
|
let fixture: ComponentFixture<AvatarProfileComponent>;
|
||||||
|
|
||||||
|
beforeEach(async () => {
|
||||||
|
await TestBed.configureTestingModule({
|
||||||
|
declarations: [ AvatarProfileComponent ]
|
||||||
|
})
|
||||||
|
.compileComponents();
|
||||||
|
});
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
fixture = TestBed.createComponent(AvatarProfileComponent);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,24 @@
|
||||||
|
import { Component, Input, OnInit } from '@angular/core';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'ov-avatar-profile',
|
||||||
|
template: `
|
||||||
|
<div class="poster" [ngStyle]="{ 'background-color': color }">
|
||||||
|
<span id="poster-text">{{letter}}</span>
|
||||||
|
</div>
|
||||||
|
`,
|
||||||
|
styleUrls: ['./avatar-profile.component.css']
|
||||||
|
})
|
||||||
|
export class AvatarProfileComponent implements OnInit {
|
||||||
|
|
||||||
|
color: string;
|
||||||
|
|
||||||
|
@Input() letter;
|
||||||
|
|
||||||
|
constructor() { }
|
||||||
|
|
||||||
|
ngOnInit(): void {
|
||||||
|
this.color = `hsl(${Math.random() * 360}, 100%, 75%)`;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -11,14 +11,3 @@ video {
|
||||||
border-radius: var(--ov-video-radius);
|
border-radius: var(--ov-video-radius);
|
||||||
background-color: #000000;
|
background-color: #000000;
|
||||||
}
|
}
|
||||||
|
|
||||||
.poster {
|
|
||||||
position: absolute;
|
|
||||||
z-index: 888;
|
|
||||||
max-width: 60%;
|
|
||||||
max-height: 60%;
|
|
||||||
bottom: 25%;
|
|
||||||
margin: auto;
|
|
||||||
right: 0;
|
|
||||||
left: 0;
|
|
||||||
}
|
|
|
@ -5,12 +5,8 @@ import { VideoType } from '../../models/video-type.model';
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ov-video',
|
selector: 'ov-video',
|
||||||
template: `
|
template: `
|
||||||
<img
|
<ov-avatar-profile *ngIf="!_streamManager?.stream?.videoActive && (type === 'CAMERA' || !type)" [letter]="'K'"></ov-avatar-profile>
|
||||||
*ngIf="!_streamManager?.stream?.videoActive && (type === 'CAMERA' || !type)"
|
|
||||||
class="poster_img"
|
|
||||||
alt="OpenVidu Logo"
|
|
||||||
src="assets/images/poster.png"
|
|
||||||
/>
|
|
||||||
<video
|
<video
|
||||||
class="OT_video-element"
|
class="OT_video-element"
|
||||||
#videoElement
|
#videoElement
|
||||||
|
@ -43,7 +39,7 @@ export class VideoComponent implements AfterViewInit {
|
||||||
|
|
||||||
@Input()
|
@Input()
|
||||||
set streamManager(streamManager: StreamManager) {
|
set streamManager(streamManager: StreamManager) {
|
||||||
if(streamManager) {
|
if (streamManager) {
|
||||||
this._streamManager = streamManager;
|
this._streamManager = streamManager;
|
||||||
if (!!this._videoElement && this._streamManager) {
|
if (!!this._videoElement && this._streamManager) {
|
||||||
this.type = <VideoType>this._streamManager?.stream?.typeOfVideo;
|
this.type = <VideoType>this._streamManager?.stream?.typeOfVideo;
|
||||||
|
|
Loading…
Reference in New Issue