Browse Source

Webview

master
marcoschmickler 4 years ago
parent
commit
71d8d1dd07
  1. 2
      kplayer/video/SVideoModel.swift
  2. 3
      kplayer/video/SVideoPlayer.swift
  3. 2
      kplayer/web/KBrowserView.swift

2
kplayer/video/SVideoModel.swift

@ -28,6 +28,8 @@ class SVideoModel : ObservableObject {
@Published var favorite = false
@Published var speed: Float = 1.0
@Published var height: Int = 0
@Published var nominalFrameRate: Int = 0
@Published var currentURL: URL?

3
kplayer/video/SVideoPlayer.swift

@ -117,6 +117,7 @@ struct SVideoPlayer: View, EditItemDelegate {
Text(model.currentSnapshot.name).foregroundColor(Color.blue)
Text(" (\(model.height),\(model.nominalFrameRate)").foregroundColor(Color.blue)
ScrollView(.horizontal, showsIndicators: false) {
HStack {
@ -570,8 +571,10 @@ struct SVideoPlayer: View, EditItemDelegate {
let heightSpace = model.proxy!.size.height * 2
var height = heightSpace
if let i = player.currentItem {
model.nominalFrameRate = await i.asset.load(.nominalFrameRate)
height = i.presentationSize.height
}
model.height = Int(height)
var f = height / heightSpace
print("h \(height) \(heightSpace) \(f)")

2
kplayer/web/KBrowserView.swift

@ -241,7 +241,7 @@ struct KBrowserView: View {
mitem.externalURL = host + url
}
else {
mitem.externalURL = url.replacingOccurrences(of: "//", with: "/")
mitem.externalURL = url //.replacingOccurrences(of: "//", with: "/")
}
mitem.cookies = cookieString

Loading…
Cancel
Save