diff --git a/Thimra.xcodeproj/project.pbxproj b/Thimra.xcodeproj/project.pbxproj index 84c4c86..5e8b772 100644 --- a/Thimra.xcodeproj/project.pbxproj +++ b/Thimra.xcodeproj/project.pbxproj @@ -11,9 +11,7 @@ /* End PBXBuildFile section */ /* Begin PBXFileReference section */ - 1AC17585C566B70F526D3938 /* Pods-ShortPlay.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ShortPlay.debug.xcconfig"; path = "Target Support Files/Pods-ShortPlay/Pods-ShortPlay.debug.xcconfig"; sourceTree = ""; }; 1DBC40592DA4EDFC0093FCB0 /* Thimra.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Thimra.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 9DF7FB1047F612A65429345F /* Pods-ShortPlay.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ShortPlay.release.xcconfig"; path = "Target Support Files/Pods-ShortPlay/Pods-ShortPlay.release.xcconfig"; sourceTree = ""; }; EF2D7FDB1FE86E5CD9908162 /* Pods_Thimra.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Thimra.framework; sourceTree = BUILT_PRODUCTS_DIR; }; F7763FEFB6BEB1A75D6FBA0A /* Pods-Thimra.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Thimra.debug.xcconfig"; path = "Target Support Files/Pods-Thimra/Pods-Thimra.debug.xcconfig"; sourceTree = ""; }; FEA583158A7C05D8D7C5A9FC /* Pods-Thimra.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Thimra.release.xcconfig"; path = "Target Support Files/Pods-Thimra/Pods-Thimra.release.xcconfig"; sourceTree = ""; }; @@ -55,8 +53,6 @@ 0061C3496D158807460301A9 /* Pods */ = { isa = PBXGroup; children = ( - 1AC17585C566B70F526D3938 /* Pods-ShortPlay.debug.xcconfig */, - 9DF7FB1047F612A65429345F /* Pods-ShortPlay.release.xcconfig */, F7763FEFB6BEB1A75D6FBA0A /* Pods-Thimra.debug.xcconfig */, FEA583158A7C05D8D7C5A9FC /* Pods-Thimra.release.xcconfig */, ); diff --git a/Thimra/Base/Networking/Base/SPURLPath.swift b/Thimra/Base/Networking/Base/SPURLPath.swift index 6c0557b..3735547 100644 --- a/Thimra/Base/Networking/Base/SPURLPath.swift +++ b/Thimra/Base/Networking/Base/SPURLPath.swift @@ -17,6 +17,8 @@ import UIKit https://api-viontv.viontv.com/b7afef99/ https://api-zyreotv.zyreotv.com/7834f11d/ + + https://thimratv.com */ #if DEBUG diff --git a/Thimra/Class/Player/Controller/SPPlayerListViewController.swift b/Thimra/Class/Player/Controller/SPPlayerListViewController.swift index 2851299..a18a0bb 100644 --- a/Thimra/Class/Player/Controller/SPPlayerListViewController.swift +++ b/Thimra/Class/Player/Controller/SPPlayerListViewController.swift @@ -56,6 +56,9 @@ class SPPlayerListViewController: SPViewController { ///自动下一级 var autoNextEpisode = false + ///是否为首次播放 + private(set) var isFirstPlay = true + private(set) var viewModel = SPPlayerListViewModel() private(set) var currentIndexPath = IndexPath(row: 0, section: 0) @@ -96,6 +99,7 @@ class SPPlayerListViewController: SPViewController { NotificationCenter.default.addObserver(self, selector: #selector(didBecomeActiveNotification), name: UIApplication.didBecomeActiveNotification, object: nil) NotificationCenter.default.addObserver(self, selector: #selector(willResignActiveNotification), name: UIApplication.willResignActiveNotification, object: nil) + sp_setupUI() sp_addActio() } @@ -159,6 +163,12 @@ class SPPlayerListViewController: SPViewController { self.loadMoreData() } + if isFirstPlay { + isFirstPlay = false + let offset = self.collectionView.contentOffset.y + 0.5 + self.collectionView.setContentOffset(CGPoint(x: 0, y: offset), animated: false) + } + if currentIndexPath.row <= 2 { // self.loadUpMoreData() } @@ -183,6 +193,8 @@ class SPPlayerListViewController: SPViewController { if !animated { if self.currentIndexPath != indexPath { self.skip(indexPath: indexPath) + } else { + self.play() } } } @@ -323,7 +335,7 @@ extension SPPlayerListViewController: UICollectionViewDelegate, UICollectionView let indexPaths = self.collectionView.indexPathsForVisibleItems for indexPath in indexPaths { guard let cell = self.collectionView.cellForItem(at: indexPath) else { continue } - if offsetY == cell.frame.origin.y { + if floor(offsetY) == floor(cell.frame.origin.y) { if self.currentIndexPath != indexPath { self.skip(indexPath: indexPath) } diff --git a/Thimra/Libs/Reachability/NetworkObserver.swift b/Thimra/Libs/Reachability/NetworkObserver.swift index dc55d75..b04aecc 100644 --- a/Thimra/Libs/Reachability/NetworkObserver.swift +++ b/Thimra/Libs/Reachability/NetworkObserver.swift @@ -20,18 +20,18 @@ class NetworkObserver { func startMonitoring() { monitor.pathUpdateHandler = { path in if path.status == .satisfied { - print("++++++Network is available") + print("++++++有网") } else { - print("++++++No network connection") + print("++++++无网") } - if path.usesInterfaceType(.wifi) { - print("++++++Using Wi-Fi") - } - - if path.usesInterfaceType(.cellular) { - print("++++++Using Cellular") - } +// if path.usesInterfaceType(.wifi) { +// print("++++++Using Wi-Fi") +// } +// +// if path.usesInterfaceType(.cellular) { +// print("++++++Using Cellular") +// } } monitor.start(queue: queue) diff --git a/Thimra/Thirdparty/JXUUID/PDKeyChain.m b/Thimra/Thirdparty/JXUUID/PDKeyChain.m index 68567dc..95d2776 100755 --- a/Thimra/Thirdparty/JXUUID/PDKeyChain.m +++ b/Thimra/Thirdparty/JXUUID/PDKeyChain.m @@ -8,7 +8,7 @@ #import "PDKeyChain.h" -static NSString * const kPDKeyChainKey = @"com.shortplay.keychainKey"; +static NSString * const kPDKeyChainKey = @"com.thimra.keychainKey"; @implementation PDKeyChain