Skip to content

Commit 265d447

Browse files
committed
Add Web Share API
1 parent 28dce64 commit 265d447

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/app/shared/ui/viewer/components/viewer-header/viewer-header.component.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434
<button class="button small" (click)="domMan.copyToClipboard(iframe())">Copy</button>
3535
</div>
3636
</details>
37+
38+
<button class="button small" (click)="shareWith()">Share with...</button>
3739
</div>
3840
</app-dialog>
3941

src/app/shared/ui/viewer/components/viewer-header/viewer-header.component.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,4 +84,12 @@ export class ViewerHeaderComponent {
8484
genId(): string {
8585
return Base64.toBase64(JSON.stringify(this.currentPlaylistItem))
8686
}
87+
88+
shareWith() {
89+
const shareData = {
90+
title: this.episode?.title,
91+
url: this.link(),
92+
};
93+
navigator?.share(shareData)
94+
}
8795
}

0 commit comments

Comments
 (0)