Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

opt: Optimized Video Player #399

Merged
merged 1 commit into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions MeowBili/Bangumi/BangumiPlayerView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ struct BangumiPlayerView: View {
.ignoresSafeArea()
.navigationBarHidden(true)
.tag(1)
._statusBarHidden(true)
.onAppear {
hideDigitalTime(true)
Timer.scheduledTimer(withTimeInterval: 15, repeats: true) { timer in
Expand Down
1 change: 1 addition & 0 deletions MeowBili/Live/LivePlayerView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ struct LivePlayerView: View {
VideoPlayer(player: livePlayer)
#if os(watchOS)
.ignoresSafeArea()
._statusBarHidden(true)
#endif
.onAppear {
let asset = AVURLAsset(url: URL(string: LiveDetailView.willPlayStreamUrl)!, options: ["AVURLAssetHTTPHeaderFieldsKey": ["User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.0 Safari/605.1.15", "Referer": "https://www.bilibili.com"]])
Expand Down
4 changes: 4 additions & 0 deletions MeowBili/Video/VideoDownloadView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
//===----------------------------------------------------------------------===//

import SwiftUI
import Dynamic
import DarockKit
import Alamofire

Expand Down Expand Up @@ -126,6 +127,9 @@ struct VideoDownloadView: View {
}
}
}
#if os(watchOS)
Dynamic.PUICApplication.sharedPUICApplication().setExtendedIdleTime(3600, disablesSleepGesture: true, wantsAutorotation: false)
#endif
}
}
}
Expand Down
1 change: 1 addition & 0 deletions MeowBili/Video/VideoPlayerView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
}
}
.allowsHitTesting(false)
.animation(.smooth)

Check notice on line 136 in MeowBili/Video/VideoPlayerView.swift

View check run for this annotation

Xcode Cloud / DarockBili | Analysis | Build - iOS

MeowBili/Video/VideoPlayerView.swift#L136

'animation' was deprecated in iOS 15.0: Use withAnimation or animation(_:value:) instead.
}
}
}
Expand Down Expand Up @@ -209,6 +209,7 @@
.animation(.smooth, value: playerScale)
.animation(.smooth, value: __playerScale)
.scrollIndicators(.never)
._statusBarHidden(true)
.tag(1)
List {
Section {
Expand Down