mirror of https://github.com/OpenVidu/openvidu.git
openvidu-testapp: when unpublished hide publisher buttons
parent
bb58206ebc
commit
34d9c197d8
|
@ -93,7 +93,7 @@ public class Participant {
|
||||||
this.streaming = streaming;
|
this.streaming = streaming;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getPublisherStremId() {
|
public String getPublisherStreamId() {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,13 +26,13 @@ import io.openvidu.java.client.SessionProperties;
|
||||||
public interface Session {
|
public interface Session {
|
||||||
|
|
||||||
String getSessionId();
|
String getSessionId();
|
||||||
|
|
||||||
SessionProperties getSessionProperties();
|
SessionProperties getSessionProperties();
|
||||||
|
|
||||||
void join(Participant participant);
|
void join(Participant participant);
|
||||||
|
|
||||||
void leave(String participantPrivateId, String reason);
|
void leave(String participantPrivateId, String reason);
|
||||||
|
|
||||||
boolean close(String reason);
|
boolean close(String reason);
|
||||||
|
|
||||||
boolean isClosed();
|
boolean isClosed();
|
||||||
|
@ -44,9 +44,9 @@ public interface Session {
|
||||||
Participant getParticipantByPublicId(String participantPublicId);
|
Participant getParticipantByPublicId(String participantPublicId);
|
||||||
|
|
||||||
int getActivePublishers();
|
int getActivePublishers();
|
||||||
|
|
||||||
JSONObject toJSON();
|
JSONObject toJSON();
|
||||||
|
|
||||||
JSONObject withStatsToJSON();
|
JSONObject withStatsToJSON();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,16 +10,16 @@
|
||||||
<button class="video-btn pub-btn" title="Publish/Unpublish" (click)="pubUnpub()">
|
<button class="video-btn pub-btn" title="Publish/Unpublish" (click)="pubUnpub()">
|
||||||
<mat-icon aria-label="Publish or unpublish" class="mat-icon material-icons" role="img" aria-hidden="true">{{pubSubIcon}}</mat-icon>
|
<mat-icon aria-label="Publish or unpublish" class="mat-icon material-icons" role="img" aria-hidden="true">{{pubSubIcon}}</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
<button *ngIf="streamManager.stream.hasVideo" class="video-btn pub-video-btn" title="Publish/Unpublish Video" (click)="pubUnpubVideo()">
|
<button *ngIf="streamManager.stream.hasVideo && !this.unpublished" class="video-btn pub-video-btn" title="Publish/Unpublish Video" (click)="pubUnpubVideo()">
|
||||||
<mat-icon aria-label="Publish or unpublish video" class="mat-icon material-icons" role="img" aria-hidden="true">{{pubSubVideoIcon}}</mat-icon>
|
<mat-icon aria-label="Publish or unpublish video" class="mat-icon material-icons" role="img" aria-hidden="true">{{pubSubVideoIcon}}</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
<button *ngIf="streamManager.stream.hasAudio" class="video-btn pub-audio-btn" title="Publish/Unpublish Audio" (click)="pubUnpubAudio()">
|
<button *ngIf="streamManager.stream.hasAudio && !this.unpublished" class="video-btn pub-audio-btn" title="Publish/Unpublish Audio" (click)="pubUnpubAudio()">
|
||||||
<mat-icon aria-label="Publish or unpublish audio" class="mat-icon material-icons" role="img" aria-hidden="true">{{pubSubAudioIcon}}</mat-icon>
|
<mat-icon aria-label="Publish or unpublish audio" class="mat-icon material-icons" role="img" aria-hidden="true">{{pubSubAudioIcon}}</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
<button class="video-btn change-publisher-btn" title="Change publisher" (click)="changePub()">
|
<button *ngIf="!this.unpublished" class="video-btn change-publisher-btn" title="Change publisher" (click)="changePub()">
|
||||||
<mat-icon aria-label="Change publisher" class="mat-icon material-icons" role="img" aria-hidden="true">switch_video</mat-icon>
|
<mat-icon aria-label="Change publisher" class="mat-icon material-icons" role="img" aria-hidden="true">switch_video</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
<button class="video-btn rec-btn publisher-rec-btn" title="Record" (click)="record()">
|
<button *ngIf="!this.unpublished" class="video-btn rec-btn publisher-rec-btn" title="Record" (click)="record()">
|
||||||
<mat-icon aria-label="Start/Stop local recording" class="mat-icon material-icons" role="img" aria-hidden="true">
|
<mat-icon aria-label="Start/Stop local recording" class="mat-icon material-icons" role="img" aria-hidden="true">
|
||||||
{{recordIcon}}</mat-icon>
|
{{recordIcon}}</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
|
|
|
@ -450,6 +450,10 @@ export class VideoComponent implements OnInit, OnDestroy {
|
||||||
event: 'streamDestroyed',
|
event: 'streamDestroyed',
|
||||||
content: e.stream.streamId
|
content: e.stream.streamId
|
||||||
});
|
});
|
||||||
|
if (e.reason.indexOf('forceUnpublish') !== -1) {
|
||||||
|
this.unpublished = !this.unpublished;
|
||||||
|
this.unpublished ? this.pubSubIcon = 'play_arrow' : this.pubSubIcon = 'stop';
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue