stupid subtitles

This commit is contained in:
Aiden Vigue 2021-06-18 11:34:01 -04:00
parent e9f6bce04b
commit 915dc45152
No known key found for this signature in database
GPG Key ID: B9A09843AB079D5B
7 changed files with 40 additions and 34 deletions

View File

@ -47,29 +47,27 @@ struct LandscapeItemElement: View {
.frame(width: 445, height: 250)
.cornerRadius(10)
.overlay(
Group {
ZStack(alignment: .leading) {
if focused && item.userData?.playedPercentage != nil {
ZStack(alignment: .leading) {
Rectangle()
.fill(LinearGradient(colors: [.black, .clear], startPoint: .bottom, endPoint: .top))
.frame(width: 445, height: 90)
.mask(CutOffShadow())
VStack(alignment: .leading) {
Text("CONTINUE • \(item.getItemProgressString())")
.font(.caption)
.fontWeight(.medium)
.offset(y: 5)
ZStack(alignment: .leading) {
RoundedRectangle(cornerRadius: 6)
.fill(Color.gray)
.opacity(0.4)
.frame(minWidth: 100, maxWidth: .infinity, minHeight: 12, maxHeight: 12)
RoundedRectangle(cornerRadius: 6)
.fill(Color(red: 172/255, green: 92/255, blue: 195/255))
.frame(width: CGFloat(item.userData?.playedPercentage ?? 0 * 4.45 - 0.16), height: 12)
}
}.padding(12)
}
Rectangle()
.fill(LinearGradient(colors: [.black, .clear], startPoint: .bottom, endPoint: .top))
.frame(width: 445, height: 90)
.mask(CutOffShadow())
VStack(alignment: .leading) {
Text("CONTINUE • \(item.getItemProgressString())")
.font(.caption)
.fontWeight(.medium)
.offset(y: 5)
ZStack(alignment: .leading) {
RoundedRectangle(cornerRadius: 6)
.fill(Color.gray)
.opacity(0.4)
.frame(minWidth: 100, maxWidth: .infinity, minHeight: 12, maxHeight: 12)
RoundedRectangle(cornerRadius: 6)
.fill(Color(red: 172/255, green: 92/255, blue: 195/255))
.frame(width: CGFloat(item.userData?.playedPercentage ?? 0 * 4.45 - 0.16), height: 12)
}
}.padding(12)
} else {
EmptyView()
}

View File

@ -20,17 +20,17 @@ struct ContinueWatchingView: View {
Text("Continue Watching")
.font(.headline)
.fontWeight(.semibold)
.padding(.leading, 135)
.padding(.leading, 90)
ScrollView(.horizontal, showsIndicators: false) {
LazyHStack {
Spacer().frame(width: 90)
Spacer().frame(width: 45)
ForEach(items, id: \.id) { item in
NavigationLink(destination: Text("itemv")) {
LandscapeItemElement(item: item)
}.buttonStyle(PlainNavigationLinkButtonStyle())
.prefersDefaultFocus(item == items.first, in: namespace)
}
Spacer().frame(width: 90)
Spacer().frame(width: 45)
}
}.frame(height: 330)
} else {

View File

@ -40,7 +40,7 @@ struct HomeView: View {
.fontWeight(.semibold)
Image(systemName: "chevron.forward.circle.fill")
}
}.padding(EdgeInsets(top: 0, leading: 135, bottom: 0, trailing: 0))
}.padding(EdgeInsets(top: 0, leading: 90, bottom: 0, trailing: 0))
LatestMediaView(usingParentID: libraryID)
}
}

View File

@ -41,13 +41,13 @@ struct LatestMediaView: View {
var body: some View {
ScrollView(.horizontal, showsIndicators: false) {
LazyHStack {
Spacer().frame(width: 90)
Spacer().frame(width: 45)
ForEach(items, id: \.id) { item in
NavigationLink(destination: Text("itemv")) {
PortraitItemElement(item: item)
}.buttonStyle(PlainNavigationLinkButtonStyle())
}
Spacer().frame(width: 90)
Spacer().frame(width: 45)
}
}.frame(height: 350)
.onAppear(perform: onAppear)

View File

@ -40,7 +40,7 @@ struct MainTabView: View {
TabView(selection: $tabSelection) {
HomeView()
.offset(y: -20)
.offset(y: -1) //don't remove this. it breaks tabview on 4K displays.
.tabItem {
Text(Tab.home.localized)
Image(systemName: "house")
@ -73,3 +73,5 @@ extension MainTabView {
}
}
}
//stream ancient dreams in a modern land by MARINA!

View File

@ -19,16 +19,16 @@ struct NextUpView: View {
Text("Next Up")
.font(.headline)
.fontWeight(.semibold)
.padding(.leading, 135)
.padding(.leading, 90)
ScrollView(.horizontal, showsIndicators: false) {
LazyHStack {
Spacer().frame(width: 90)
Spacer().frame(width: 45)
ForEach(items, id: \.id) { item in
NavigationLink(destination: Text("itemv")) {
LandscapeItemElement(item: item)
}.buttonStyle(PlainNavigationLinkButtonStyle())
}
Spacer().frame(width: 90)
Spacer().frame(width: 45)
}
}.frame(height: 330)
.offset(y: -10)

View File

@ -326,7 +326,10 @@ class PlayerViewController: UIViewController, VLCMediaDelegate, VLCMediaPlayerDe
deliveryUrl = nil
}
let subtitle = Subtitle(name: stream.displayTitle ?? "Unknown", id: Int32(stream.index!), url: deliveryUrl, delivery: stream.deliveryMethod!, codec: stream.codec ?? "webvtt")
subtitleTrackArray.append(subtitle)
if(subtitle.delivery != .encode) {
subtitleTrackArray.append(subtitle)
}
}
if stream.type == .audio {
@ -367,7 +370,10 @@ class PlayerViewController: UIViewController, VLCMediaDelegate, VLCMediaPlayerDe
deliveryUrl = nil
}
let subtitle = Subtitle(name: stream.displayTitle ?? "Unknown", id: Int32(stream.index!), url: deliveryUrl, delivery: stream.deliveryMethod!, codec: stream.codec ?? "webvtt")
subtitleTrackArray.append(subtitle)
if(subtitle.delivery != .encode) {
subtitleTrackArray.append(subtitle)
}
}
if stream.type == .audio {