mirror of
https://github.com/yattee/yattee.git
synced 2025-08-09 20:24:06 +00:00
Initial PeerTube Support
This commit is contained in:
@@ -20,6 +20,7 @@ struct ShareButton<LabelView: View>: View {
|
||||
}
|
||||
|
||||
@ViewBuilder var body: some View {
|
||||
// TODO: this should work with other content item types
|
||||
if let video = contentItem.video, !video.localStreamIsFile {
|
||||
Menu {
|
||||
if video.localStreamIsRemoteURL {
|
||||
@@ -44,7 +45,7 @@ struct ShareButton<LabelView: View>: View {
|
||||
private var instanceActions: some View {
|
||||
Group {
|
||||
Button(labelForShareURL(accounts.app.name)) {
|
||||
if let url = player.playerAPI.shareURL(contentItem) {
|
||||
if let url = player.playerAPI(contentItem.video).shareURL(contentItem) {
|
||||
shareAction(url)
|
||||
} else {
|
||||
navigation.presentAlert(
|
||||
@@ -57,7 +58,7 @@ struct ShareButton<LabelView: View>: View {
|
||||
if contentItemIsPlayerCurrentVideo {
|
||||
Button(labelForShareURL(accounts.app.name, withTime: true)) {
|
||||
shareAction(
|
||||
player.playerAPI.shareURL(
|
||||
player.playerAPI(player.currentVideo!).shareURL(
|
||||
contentItem,
|
||||
time: player.backend.currentTime
|
||||
)!
|
||||
|
@@ -148,7 +148,7 @@ struct VideoContextMenuView: View {
|
||||
|
||||
var markAsWatchedButton: some View {
|
||||
Button {
|
||||
Watch.markAsWatched(videoID: video.videoID, duration: video.length, context: backgroundContext)
|
||||
Watch.markAsWatched(videoID: video.videoID, account: accounts.current, duration: video.length, context: backgroundContext)
|
||||
} label: {
|
||||
Label("Mark as watched", systemImage: "checkmark.circle.fill")
|
||||
}
|
||||
|
Reference in New Issue
Block a user