Add buttons in playlist page
To delete/edit/share the playlist
This commit is contained in:
parent
10846ef656
commit
82f443de1a
|
@ -5,10 +5,33 @@
|
||||||
*ngIf="playlist" [playlist]="playlist" [toManage]="false" [displayChannel]="true"
|
*ngIf="playlist" [playlist]="playlist" [toManage]="false" [displayChannel]="true"
|
||||||
[displayDescription]="true" [displayPrivacy]="true"
|
[displayDescription]="true" [displayPrivacy]="true"
|
||||||
></my-video-playlist-miniature>
|
></my-video-playlist-miniature>
|
||||||
|
|
||||||
|
<div class="playlist-buttons">
|
||||||
|
<button (click)="showShareModal()" class="action-button share-button">
|
||||||
|
<my-global-icon iconName="share" aria-hidden="true"></my-global-icon>
|
||||||
|
<span class="icon-text" i18n>Share</span>
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<my-action-dropdown
|
||||||
|
*ngIf="isRegularPlaylist(playlist)"
|
||||||
|
[entry]="playlist" [actions]="playlistActions" label="More"
|
||||||
|
></my-action-dropdown>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="playlist-elements col-xs-12 col-md-7 col-xl-9">
|
<div class="playlist-elements col-xs-12 col-md-7 col-xl-9">
|
||||||
<div i18n class="no-results" *ngIf="pagination.totalItems === 0">No videos in this playlist.</div>
|
<div class="no-results" *ngIf="pagination.totalItems === 0">
|
||||||
|
<div i18n>No videos in this playlist.</div>
|
||||||
|
|
||||||
|
<div i18n>
|
||||||
|
Browse videos on PeerTube to add them in your playlist.
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div i18n>
|
||||||
|
See the <a target="_blank" href="https://docs.joinpeertube.org/#/use-library?id=playlist">documentation</a> for more information.
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
class="videos" myInfiniteScroller [autoInit]="true" (nearOfBottom)="onNearOfBottom()"
|
class="videos" myInfiniteScroller [autoInit]="true" (nearOfBottom)="onNearOfBottom()"
|
||||||
|
@ -24,3 +47,5 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<my-video-share #videoShareModal [playlist]="playlist"></my-video-share>
|
||||||
|
|
|
@ -10,7 +10,9 @@
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
|
|
||||||
display: flex;
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
/* fix ellipsis dots background color */
|
/* fix ellipsis dots background color */
|
||||||
::ng-deep .miniature-name::after {
|
::ng-deep .miniature-name::after {
|
||||||
|
@ -18,6 +20,20 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.playlist-buttons {
|
||||||
|
display:flex;
|
||||||
|
margin: 30px 0 10px 0;
|
||||||
|
|
||||||
|
.share-button {
|
||||||
|
@include peertube-button;
|
||||||
|
@include button-with-icon(17px, 3px, -1px);
|
||||||
|
@include grey-button;
|
||||||
|
@include apply-svg-color(pvar(--actionButtonColor));
|
||||||
|
|
||||||
|
margin-right: 10px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Thanks Angular CDK <3 https://material.angular.io/cdk/drag-drop/examples
|
// Thanks Angular CDK <3 https://material.angular.io/cdk/drag-drop/examples
|
||||||
.cdk-drag-preview {
|
.cdk-drag-preview {
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
|
|
@ -1,9 +1,13 @@
|
||||||
import { Subject, Subscription } from 'rxjs'
|
import { Subject, Subscription } from 'rxjs'
|
||||||
import { CdkDragDrop } from '@angular/cdk/drag-drop'
|
import { CdkDragDrop } from '@angular/cdk/drag-drop'
|
||||||
import { Component, OnDestroy, OnInit } from '@angular/core'
|
import { Component, OnDestroy, OnInit, ViewChild } from '@angular/core'
|
||||||
import { ActivatedRoute } from '@angular/router'
|
import { ActivatedRoute, Router } from '@angular/router'
|
||||||
import { ComponentPagination, Notifier, ScreenService } from '@app/core'
|
import { ComponentPagination, ConfirmService, Notifier, ScreenService } from '@app/core'
|
||||||
|
import { DropdownAction } from '@app/shared/shared-main'
|
||||||
|
import { VideoShareComponent } from '@app/shared/shared-share-modal'
|
||||||
import { VideoPlaylist, VideoPlaylistElement, VideoPlaylistService } from '@app/shared/shared-video-playlist'
|
import { VideoPlaylist, VideoPlaylistElement, VideoPlaylistService } from '@app/shared/shared-video-playlist'
|
||||||
|
import { I18n } from '@ngx-translate/i18n-polyfill'
|
||||||
|
import { VideoPlaylistType } from '@shared/models'
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'my-account-video-playlist-elements',
|
selector: 'my-account-video-playlist-elements',
|
||||||
|
@ -11,9 +15,13 @@ import { VideoPlaylist, VideoPlaylistElement, VideoPlaylistService } from '@app/
|
||||||
styleUrls: [ './my-account-video-playlist-elements.component.scss' ]
|
styleUrls: [ './my-account-video-playlist-elements.component.scss' ]
|
||||||
})
|
})
|
||||||
export class MyAccountVideoPlaylistElementsComponent implements OnInit, OnDestroy {
|
export class MyAccountVideoPlaylistElementsComponent implements OnInit, OnDestroy {
|
||||||
|
@ViewChild('videoShareModal') videoShareModal: VideoShareComponent
|
||||||
|
|
||||||
playlistElements: VideoPlaylistElement[] = []
|
playlistElements: VideoPlaylistElement[] = []
|
||||||
playlist: VideoPlaylist
|
playlist: VideoPlaylist
|
||||||
|
|
||||||
|
playlistActions: DropdownAction<VideoPlaylist>[][] = []
|
||||||
|
|
||||||
pagination: ComponentPagination = {
|
pagination: ComponentPagination = {
|
||||||
currentPage: 1,
|
currentPage: 1,
|
||||||
itemsPerPage: 10,
|
itemsPerPage: 10,
|
||||||
|
@ -27,12 +35,30 @@ export class MyAccountVideoPlaylistElementsComponent implements OnInit, OnDestro
|
||||||
|
|
||||||
constructor (
|
constructor (
|
||||||
private notifier: Notifier,
|
private notifier: Notifier,
|
||||||
|
private i18n: I18n,
|
||||||
|
private router: Router,
|
||||||
|
private confirmService: ConfirmService,
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
private screenService: ScreenService,
|
private screenService: ScreenService,
|
||||||
private videoPlaylistService: VideoPlaylistService
|
private videoPlaylistService: VideoPlaylistService
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
ngOnInit () {
|
ngOnInit () {
|
||||||
|
this.playlistActions = [
|
||||||
|
[
|
||||||
|
{
|
||||||
|
label: this.i18n('Update playlist'),
|
||||||
|
iconName: 'edit',
|
||||||
|
linkBuilder: playlist => [ '/my-account', 'video-playlists', 'update', playlist.uuid ]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: this.i18n('Delete playlist'),
|
||||||
|
iconName: 'delete',
|
||||||
|
handler: playlist => this.deleteVideoPlaylist(playlist)
|
||||||
|
}
|
||||||
|
]
|
||||||
|
]
|
||||||
|
|
||||||
this.paramsSub = this.route.params.subscribe(routeParams => {
|
this.paramsSub = this.route.params.subscribe(routeParams => {
|
||||||
this.videoPlaylistId = routeParams[ 'videoPlaylistId' ]
|
this.videoPlaylistId = routeParams[ 'videoPlaylistId' ]
|
||||||
this.loadElements()
|
this.loadElements()
|
||||||
|
@ -90,6 +116,38 @@ export class MyAccountVideoPlaylistElementsComponent implements OnInit, OnDestro
|
||||||
return elem.id
|
return elem.id
|
||||||
}
|
}
|
||||||
|
|
||||||
|
isRegularPlaylist (playlist: VideoPlaylist) {
|
||||||
|
return playlist?.type.id === VideoPlaylistType.REGULAR
|
||||||
|
}
|
||||||
|
|
||||||
|
showShareModal () {
|
||||||
|
this.videoShareModal.show()
|
||||||
|
}
|
||||||
|
|
||||||
|
async deleteVideoPlaylist (videoPlaylist: VideoPlaylist) {
|
||||||
|
const res = await this.confirmService.confirm(
|
||||||
|
this.i18n(
|
||||||
|
'Do you really want to delete {{playlistDisplayName}}?',
|
||||||
|
{ playlistDisplayName: videoPlaylist.displayName }
|
||||||
|
),
|
||||||
|
this.i18n('Delete')
|
||||||
|
)
|
||||||
|
if (res === false) return
|
||||||
|
|
||||||
|
this.videoPlaylistService.removeVideoPlaylist(videoPlaylist)
|
||||||
|
.subscribe(
|
||||||
|
() => {
|
||||||
|
this.router.navigate([ '/my-account', 'video-playlists' ])
|
||||||
|
|
||||||
|
this.notifier.success(
|
||||||
|
this.i18n('Playlist {{playlistDisplayName}} deleted.', { playlistDisplayName: videoPlaylist.displayName })
|
||||||
|
)
|
||||||
|
},
|
||||||
|
|
||||||
|
error => this.notifier.error(error.message)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns null to not have drag and drop delay.
|
* Returns null to not have drag and drop delay.
|
||||||
* In small views, where elements are about 100% wide,
|
* In small views, where elements are about 100% wide,
|
||||||
|
|
|
@ -8,6 +8,7 @@ import { SharedFormModule } from '@app/shared/shared-forms'
|
||||||
import { SharedGlobalIconModule } from '@app/shared/shared-icons'
|
import { SharedGlobalIconModule } from '@app/shared/shared-icons'
|
||||||
import { SharedMainModule } from '@app/shared/shared-main'
|
import { SharedMainModule } from '@app/shared/shared-main'
|
||||||
import { SharedModerationModule } from '@app/shared/shared-moderation'
|
import { SharedModerationModule } from '@app/shared/shared-moderation'
|
||||||
|
import { SharedShareModal } from '@app/shared/shared-share-modal'
|
||||||
import { SharedUserInterfaceSettingsModule } from '@app/shared/shared-user-settings'
|
import { SharedUserInterfaceSettingsModule } from '@app/shared/shared-user-settings'
|
||||||
import { SharedUserSubscriptionModule } from '@app/shared/shared-user-subscription/shared-user-subscription.module'
|
import { SharedUserSubscriptionModule } from '@app/shared/shared-user-subscription/shared-user-subscription.module'
|
||||||
import { SharedVideoMiniatureModule } from '@app/shared/shared-video-miniature'
|
import { SharedVideoMiniatureModule } from '@app/shared/shared-video-miniature'
|
||||||
|
@ -53,7 +54,8 @@ import { MyAccountComponent } from './my-account.component'
|
||||||
SharedVideoPlaylistModule,
|
SharedVideoPlaylistModule,
|
||||||
SharedUserInterfaceSettingsModule,
|
SharedUserInterfaceSettingsModule,
|
||||||
SharedGlobalIconModule,
|
SharedGlobalIconModule,
|
||||||
SharedAbuseListModule
|
SharedAbuseListModule,
|
||||||
|
SharedShareModal
|
||||||
],
|
],
|
||||||
|
|
||||||
declarations: [
|
declarations: [
|
||||||
|
|
|
@ -119,6 +119,7 @@
|
||||||
|
|
||||||
<my-video-download #videoDownloadModal></my-video-download>
|
<my-video-download #videoDownloadModal></my-video-download>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
<ng-container *ngIf="isUserLoggedIn()">
|
<ng-container *ngIf="isUserLoggedIn()">
|
||||||
<my-video-actions-dropdown
|
<my-video-actions-dropdown
|
||||||
placement="bottom auto" buttonDirection="horizontal" [buttonStyled]="true" [video]="video" [videoCaptions]="videoCaptions"
|
placement="bottom auto" buttonDirection="horizontal" [buttonStyled]="true" [video]="video" [videoCaptions]="videoCaptions"
|
||||||
|
|
|
@ -8,12 +8,14 @@ import { AuthService, AuthUser, ConfirmService, MarkdownService, Notifier, RestE
|
||||||
import { HooksService } from '@app/core/plugins/hooks.service'
|
import { HooksService } from '@app/core/plugins/hooks.service'
|
||||||
import { RedirectService } from '@app/core/routing/redirect.service'
|
import { RedirectService } from '@app/core/routing/redirect.service'
|
||||||
import { isXPercentInViewport, scrollToTop } from '@app/helpers'
|
import { isXPercentInViewport, scrollToTop } from '@app/helpers'
|
||||||
import { peertubeLocalStorage } from '@root-helpers/peertube-web-storage'
|
|
||||||
import { Video, VideoCaptionService, VideoDetails, VideoService } from '@app/shared/shared-main'
|
import { Video, VideoCaptionService, VideoDetails, VideoService } from '@app/shared/shared-main'
|
||||||
|
import { VideoShareComponent } from '@app/shared/shared-share-modal'
|
||||||
import { SubscribeButtonComponent } from '@app/shared/shared-user-subscription'
|
import { SubscribeButtonComponent } from '@app/shared/shared-user-subscription'
|
||||||
|
import { VideoDownloadComponent } from '@app/shared/shared-video-miniature'
|
||||||
import { VideoPlaylist, VideoPlaylistService } from '@app/shared/shared-video-playlist'
|
import { VideoPlaylist, VideoPlaylistService } from '@app/shared/shared-video-playlist'
|
||||||
import { MetaService } from '@ngx-meta/core'
|
import { MetaService } from '@ngx-meta/core'
|
||||||
import { I18n } from '@ngx-translate/i18n-polyfill'
|
import { I18n } from '@ngx-translate/i18n-polyfill'
|
||||||
|
import { peertubeLocalStorage } from '@root-helpers/peertube-web-storage'
|
||||||
import { ServerConfig, UserVideoRateType, VideoCaption, VideoPrivacy, VideoState } from '@shared/models'
|
import { ServerConfig, UserVideoRateType, VideoCaption, VideoPrivacy, VideoState } from '@shared/models'
|
||||||
import { getStoredP2PEnabled, getStoredTheater } from '../../../assets/player/peertube-player-local-storage'
|
import { getStoredP2PEnabled, getStoredTheater } from '../../../assets/player/peertube-player-local-storage'
|
||||||
import {
|
import {
|
||||||
|
@ -26,10 +28,8 @@ import {
|
||||||
} from '../../../assets/player/peertube-player-manager'
|
} from '../../../assets/player/peertube-player-manager'
|
||||||
import { isWebRTCDisabled, timeToInt } from '../../../assets/player/utils'
|
import { isWebRTCDisabled, timeToInt } from '../../../assets/player/utils'
|
||||||
import { environment } from '../../../environments/environment'
|
import { environment } from '../../../environments/environment'
|
||||||
import { VideoShareComponent } from './modal/video-share.component'
|
|
||||||
import { VideoSupportComponent } from './modal/video-support.component'
|
import { VideoSupportComponent } from './modal/video-support.component'
|
||||||
import { VideoWatchPlaylistComponent } from './video-watch-playlist.component'
|
import { VideoWatchPlaylistComponent } from './video-watch-playlist.component'
|
||||||
import { VideoDownloadComponent } from '@app/shared/shared-video-miniature'
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'my-video-watch',
|
selector: 'my-video-watch',
|
||||||
|
|
|
@ -1,19 +1,17 @@
|
||||||
import { QRCodeModule } from 'angularx-qrcode'
|
|
||||||
import { NgModule } from '@angular/core'
|
import { NgModule } from '@angular/core'
|
||||||
import { SharedFormModule } from '@app/shared/shared-forms'
|
import { SharedFormModule } from '@app/shared/shared-forms'
|
||||||
import { SharedGlobalIconModule } from '@app/shared/shared-icons'
|
import { SharedGlobalIconModule } from '@app/shared/shared-icons'
|
||||||
import { SharedMainModule } from '@app/shared/shared-main'
|
import { SharedMainModule } from '@app/shared/shared-main'
|
||||||
import { SharedModerationModule } from '@app/shared/shared-moderation'
|
import { SharedModerationModule } from '@app/shared/shared-moderation'
|
||||||
|
import { SharedShareModal } from '@app/shared/shared-share-modal'
|
||||||
import { SharedUserSubscriptionModule } from '@app/shared/shared-user-subscription'
|
import { SharedUserSubscriptionModule } from '@app/shared/shared-user-subscription'
|
||||||
import { SharedVideoCommentModule } from '@app/shared/shared-video-comment'
|
import { SharedVideoCommentModule } from '@app/shared/shared-video-comment'
|
||||||
import { SharedVideoMiniatureModule } from '@app/shared/shared-video-miniature'
|
import { SharedVideoMiniatureModule } from '@app/shared/shared-video-miniature'
|
||||||
import { SharedVideoPlaylistModule } from '@app/shared/shared-video-playlist'
|
import { SharedVideoPlaylistModule } from '@app/shared/shared-video-playlist'
|
||||||
import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'
|
|
||||||
import { VideoCommentService } from '../../shared/shared-video-comment/video-comment.service'
|
import { VideoCommentService } from '../../shared/shared-video-comment/video-comment.service'
|
||||||
import { VideoCommentAddComponent } from './comment/video-comment-add.component'
|
import { VideoCommentAddComponent } from './comment/video-comment-add.component'
|
||||||
import { VideoCommentComponent } from './comment/video-comment.component'
|
import { VideoCommentComponent } from './comment/video-comment.component'
|
||||||
import { VideoCommentsComponent } from './comment/video-comments.component'
|
import { VideoCommentsComponent } from './comment/video-comments.component'
|
||||||
import { VideoShareComponent } from './modal/video-share.component'
|
|
||||||
import { VideoSupportComponent } from './modal/video-support.component'
|
import { VideoSupportComponent } from './modal/video-support.component'
|
||||||
import { RecommendationsModule } from './recommendations/recommendations.module'
|
import { RecommendationsModule } from './recommendations/recommendations.module'
|
||||||
import { TimestampRouteTransformerDirective } from './timestamp-route-transformer.directive'
|
import { TimestampRouteTransformerDirective } from './timestamp-route-transformer.directive'
|
||||||
|
@ -25,8 +23,6 @@ import { VideoWatchComponent } from './video-watch.component'
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
VideoWatchRoutingModule,
|
VideoWatchRoutingModule,
|
||||||
NgbTooltipModule,
|
|
||||||
QRCodeModule,
|
|
||||||
RecommendationsModule,
|
RecommendationsModule,
|
||||||
|
|
||||||
SharedMainModule,
|
SharedMainModule,
|
||||||
|
@ -36,14 +32,14 @@ import { VideoWatchComponent } from './video-watch.component'
|
||||||
SharedUserSubscriptionModule,
|
SharedUserSubscriptionModule,
|
||||||
SharedModerationModule,
|
SharedModerationModule,
|
||||||
SharedGlobalIconModule,
|
SharedGlobalIconModule,
|
||||||
SharedVideoCommentModule
|
SharedVideoCommentModule,
|
||||||
|
SharedShareModal
|
||||||
],
|
],
|
||||||
|
|
||||||
declarations: [
|
declarations: [
|
||||||
VideoWatchComponent,
|
VideoWatchComponent,
|
||||||
VideoWatchPlaylistComponent,
|
VideoWatchPlaylistComponent,
|
||||||
|
|
||||||
VideoShareComponent,
|
|
||||||
VideoSupportComponent,
|
VideoSupportComponent,
|
||||||
VideoCommentsComponent,
|
VideoCommentsComponent,
|
||||||
VideoCommentAddComponent,
|
VideoCommentAddComponent,
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
export * from './video-share.component'
|
||||||
|
|
||||||
|
export * from './shared-share-modal.module'
|
|
@ -0,0 +1,27 @@
|
||||||
|
import { QRCodeModule } from 'angularx-qrcode'
|
||||||
|
import { NgModule } from '@angular/core'
|
||||||
|
import { SharedFormModule } from '../shared-forms'
|
||||||
|
import { SharedGlobalIconModule } from '../shared-icons'
|
||||||
|
import { SharedMainModule } from '../shared-main/shared-main.module'
|
||||||
|
import { VideoShareComponent } from './video-share.component'
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [
|
||||||
|
QRCodeModule,
|
||||||
|
|
||||||
|
SharedMainModule,
|
||||||
|
SharedFormModule,
|
||||||
|
SharedGlobalIconModule
|
||||||
|
],
|
||||||
|
|
||||||
|
declarations: [
|
||||||
|
VideoShareComponent
|
||||||
|
],
|
||||||
|
|
||||||
|
exports: [
|
||||||
|
VideoShareComponent
|
||||||
|
],
|
||||||
|
|
||||||
|
providers: [ ]
|
||||||
|
})
|
||||||
|
export class SharedShareModal { }
|
|
@ -7,8 +7,8 @@
|
||||||
|
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
|
|
||||||
<div class="playlist" *ngIf="hasPlaylist()">
|
<div class="playlist" *ngIf="playlist">
|
||||||
<div class="title-page title-page-single" i18n>Share the playlist</div>
|
<div class="title-page title-page-single" i18n *ngIf="video">Share the playlist</div>
|
||||||
|
|
||||||
<div ngbNav #nav="ngbNav" class="nav-tabs" [(activeId)]="activePlaylistId">
|
<div ngbNav #nav="ngbNav" class="nav-tabs" [(activeId)]="activePlaylistId">
|
||||||
|
|
||||||
|
@ -53,7 +53,7 @@
|
||||||
|
|
||||||
<div class="filters">
|
<div class="filters">
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group" *ngIf="video">
|
||||||
<my-peertube-checkbox inputName="includeVideoInPlaylist" [(ngModel)]="includeVideoInPlaylist" i18n-labelText
|
<my-peertube-checkbox inputName="includeVideoInPlaylist" [(ngModel)]="includeVideoInPlaylist" i18n-labelText
|
||||||
labelText="Share the playlist at this video position"></my-peertube-checkbox>
|
labelText="Share the playlist at this video position"></my-peertube-checkbox>
|
||||||
</div>
|
</div>
|
||||||
|
@ -62,8 +62,8 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="video">
|
<div class="video" *ngIf="video">
|
||||||
<div class="title-page title-page-single" *ngIf="hasPlaylist()" i18n>Share the video</div>
|
<div class="title-page title-page-single" *ngIf="playlist" i18n>Share the video</div>
|
||||||
|
|
||||||
<div ngbNav #nav="ngbNav" class="nav-tabs" [(activeId)]="activeVideoId">
|
<div ngbNav #nav="ngbNav" class="nav-tabs" [(activeId)]="activeVideoId">
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
import { Component, ElementRef, Input, ViewChild } from '@angular/core'
|
import { Component, ElementRef, Input, ViewChild } from '@angular/core'
|
||||||
import { buildVideoOrPlaylistEmbed, buildVideoLink, buildPlaylistLink } from '../../../../assets/player/utils'
|
|
||||||
import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
|
|
||||||
import { VideoCaption } from '@shared/models'
|
|
||||||
import { VideoDetails } from '@app/shared/shared-main'
|
import { VideoDetails } from '@app/shared/shared-main'
|
||||||
import { VideoPlaylist } from '@app/shared/shared-video-playlist'
|
import { VideoPlaylist } from '@app/shared/shared-video-playlist'
|
||||||
|
import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
|
||||||
|
import { VideoCaption } from '@shared/models'
|
||||||
|
import { buildPlaylistLink, buildVideoLink, buildVideoOrPlaylistEmbed } from '../../../assets/player/utils'
|
||||||
|
|
||||||
type Customizations = {
|
type Customizations = {
|
||||||
startAtCheckbox: boolean
|
startAtCheckbox: boolean
|
||||||
|
@ -51,7 +51,7 @@ export class VideoShareComponent {
|
||||||
|
|
||||||
show (currentVideoTimestamp?: number, currentPlaylistPosition?: number) {
|
show (currentVideoTimestamp?: number, currentPlaylistPosition?: number) {
|
||||||
let subtitle: string
|
let subtitle: string
|
||||||
if (this.videoCaptions.length !== 0) {
|
if (this.videoCaptions && this.videoCaptions.length !== 0) {
|
||||||
subtitle = this.videoCaptions[0].language.id
|
subtitle = this.videoCaptions[0].language.id
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@ export class VideoShareComponent {
|
||||||
startAt: currentVideoTimestamp ? Math.floor(currentVideoTimestamp) : 0,
|
startAt: currentVideoTimestamp ? Math.floor(currentVideoTimestamp) : 0,
|
||||||
|
|
||||||
stopAtCheckbox: false,
|
stopAtCheckbox: false,
|
||||||
stopAt: this.video.duration,
|
stopAt: this.video?.duration,
|
||||||
|
|
||||||
subtitleCheckbox: false,
|
subtitleCheckbox: false,
|
||||||
subtitle,
|
subtitle,
|
||||||
|
@ -118,10 +118,6 @@ export class VideoShareComponent {
|
||||||
return this.activeVideoId === 'embed'
|
return this.activeVideoId === 'embed'
|
||||||
}
|
}
|
||||||
|
|
||||||
hasPlaylist () {
|
|
||||||
return !!this.playlist
|
|
||||||
}
|
|
||||||
|
|
||||||
private getPlaylistOptions (baseUrl?: string) {
|
private getPlaylistOptions (baseUrl?: string) {
|
||||||
return {
|
return {
|
||||||
baseUrl,
|
baseUrl,
|
|
@ -282,6 +282,7 @@ table {
|
||||||
max-height: 500px;
|
max-height: 500px;
|
||||||
|
|
||||||
display: flex;
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
|
|
Loading…
Reference in New Issue