Skip to content

Commit

Permalink
Merge pull request #399 from Darock-Studio/opt/player
Browse files Browse the repository at this point in the history
opt: Optimized Video Player
  • Loading branch information
Mark Chan authored Aug 20, 2024
2 parents 2e5f144 + 8293450 commit a3abf3f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 0 deletions.
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 @@ -209,6 +209,7 @@ struct VideoPlayerView: View {
.animation(.smooth, value: playerScale)
.animation(.smooth, value: __playerScale)
.scrollIndicators(.never)
._statusBarHidden(true)
.tag(1)
List {
Section {
Expand Down

0 comments on commit a3abf3f

Please sign in to comment.