Browse Source

Swift 4

master
Marco Schmickler 8 years ago
parent
commit
6c852bf403
  1. 6
      Podfile
  2. 40
      kplayer.xcodeproj/project.pbxproj
  3. 2
      kplayer/core/MediaItem.swift
  4. 3
      kplayer/detail/VideoPlayerController.swift

6
Podfile

@ -7,15 +7,15 @@ target 'kplayer' do
# pod 'Player' # pod 'Player'
#pod 'Alamofire', :git => 'https://github.com/Alamofire/Alamofire.git', :branch => 'swift-2.0' #pod 'Alamofire', :git => 'https://github.com/Alamofire/Alamofire.git', :branch => 'swift-2.0'
#pod 'Alamofire', '~> 1.2' #pod 'Alamofire', '~> 1.2'
pod 'Alamofire', '~> 4.2'
pod 'ALMoviePlayerController', '~>0.3.0'
pod 'Alamofire', '4.7'
pod 'ALMoviePlayerController', '0.3.0'
#pod 'DZVideoPlayerViewController' #pod 'DZVideoPlayerViewController'
#pod 'SwiftyJSON' #pod 'SwiftyJSON'
#pod 'HanekeSwift' #pod 'HanekeSwift'
pod 'HanekeSwift', :git => 'https://github.com/jasonnoahchoi/HanekeSwift', :branch => 'swift3' pod 'HanekeSwift', :git => 'https://github.com/jasonnoahchoi/HanekeSwift', :branch => 'swift3'
pod 'Nimbus/Photos' pod 'Nimbus/Photos'
pod 'Nimbus/PagingScrollView' pod 'Nimbus/PagingScrollView'
pod 'BMPlayer'
pod 'BMPlayer', '0.8.6'
#pod 'AFNetworking', '~>2.1' #pod 'AFNetworking', '~>2.1'
#pod 'Dollar', '6.1.0' #pod 'Dollar', '6.1.0'
#pod 'Cent', '6.0.3' #pod 'Cent', '6.0.3'

40
kplayer.xcodeproj/project.pbxproj

@ -29,6 +29,7 @@
1C736D16E81BA1FB325200E0 /* HanekeFetchOperation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1C7360744ABACC3557D05760 /* HanekeFetchOperation.swift */; }; 1C736D16E81BA1FB325200E0 /* HanekeFetchOperation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1C7360744ABACC3557D05760 /* HanekeFetchOperation.swift */; };
1C736D24891597F2728230EE /* ImageLoadOperation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1C7360A94DBECA685ED8602F /* ImageLoadOperation.swift */; }; 1C736D24891597F2728230EE /* ImageLoadOperation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1C7360A94DBECA685ED8602F /* ImageLoadOperation.swift */; };
1C736D24B49451141CD4B64D /* DetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1C7369F53095B7A4D65679C2 /* DetailViewController.swift */; }; 1C736D24B49451141CD4B64D /* DetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1C7369F53095B7A4D65679C2 /* DetailViewController.swift */; };
1C736E1B6330FC91332F204D /* scratch2.txt in Resources */ = {isa = PBXBuildFile; fileRef = 1C7362A332872013B9B04CBB /* scratch2.txt */; };
1C736F6A223D4ADB2E1BA733 /* ItemCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1C736069C214E9522BB1BD97 /* ItemCell.swift */; }; 1C736F6A223D4ADB2E1BA733 /* ItemCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1C736069C214E9522BB1BD97 /* ItemCell.swift */; };
1C736FB92B19FE17E4357C85 /* MediaItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1C73688DAB88F9360FB62A49 /* MediaItem.swift */; }; 1C736FB92B19FE17E4357C85 /* MediaItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1C73688DAB88F9360FB62A49 /* MediaItem.swift */; };
AA74B07A01F0E99E6DEC7D1B /* Pods_kplayer.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8B75159FFCD5A882E6F167FE /* Pods_kplayer.framework */; }; AA74B07A01F0E99E6DEC7D1B /* Pods_kplayer.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8B75159FFCD5A882E6F167FE /* Pods_kplayer.framework */; };
@ -59,6 +60,7 @@
1C73620D01687FB4F1811C5C /* NetworkHelper.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NetworkHelper.swift; sourceTree = "<group>"; }; 1C73620D01687FB4F1811C5C /* NetworkHelper.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NetworkHelper.swift; sourceTree = "<group>"; };
1C736253AB7A95EA41B605B7 /* ItemModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ItemModel.swift; sourceTree = "<group>"; }; 1C736253AB7A95EA41B605B7 /* ItemModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ItemModel.swift; sourceTree = "<group>"; };
1C736260E748CF136FF37EA7 /* UploadOperation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UploadOperation.swift; sourceTree = "<group>"; }; 1C736260E748CF136FF37EA7 /* UploadOperation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UploadOperation.swift; sourceTree = "<group>"; };
1C7362A332872013B9B04CBB /* scratch2.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = scratch2.txt; sourceTree = "<group>"; };
1C73648CEC974A2500172064 /* ViewControllerExtensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ViewControllerExtensions.swift; sourceTree = "<group>"; }; 1C73648CEC974A2500172064 /* ViewControllerExtensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ViewControllerExtensions.swift; sourceTree = "<group>"; };
1C7365B06FA66294E99AC2D3 /* NetworkManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NetworkManager.swift; sourceTree = "<group>"; }; 1C7365B06FA66294E99AC2D3 /* NetworkManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NetworkManager.swift; sourceTree = "<group>"; };
1C7367379DEE94EBF3FAFA78 /* VideoPlayerController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = VideoPlayerController.swift; sourceTree = "<group>"; }; 1C7367379DEE94EBF3FAFA78 /* VideoPlayerController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = VideoPlayerController.swift; sourceTree = "<group>"; };
@ -228,6 +230,7 @@
1C7363B608460DED4F522D1C /* photo */, 1C7363B608460DED4F522D1C /* photo */,
1C736E3BE8EC464D6F5DC8FA /* scratch.txt */, 1C736E3BE8EC464D6F5DC8FA /* scratch.txt */,
1C736F3946A38499113D351A /* video */, 1C736F3946A38499113D351A /* video */,
1C7362A332872013B9B04CBB /* scratch2.txt */,
); );
path = kplayer; path = kplayer;
sourceTree = "<group>"; sourceTree = "<group>";
@ -269,7 +272,6 @@
C98AF5CC1B124D6A00D196CC /* Frameworks */, C98AF5CC1B124D6A00D196CC /* Frameworks */,
C98AF5CD1B124D6A00D196CC /* Resources */, C98AF5CD1B124D6A00D196CC /* Resources */,
34FE5806529FEB6C56D30822 /* [CP] Embed Pods Frameworks */, 34FE5806529FEB6C56D30822 /* [CP] Embed Pods Frameworks */,
9901417B0A169BA87853DAAE /* [CP] Copy Pods Resources */,
); );
buildRules = ( buildRules = (
); );
@ -351,6 +353,7 @@
C98AF5E11B124D6A00D196CC /* Images.xcassets in Resources */, C98AF5E11B124D6A00D196CC /* Images.xcassets in Resources */,
1C736A5FA5BA53B2597F2ED7 /* Kirschkeks-256x256.png in Resources */, 1C736A5FA5BA53B2597F2ED7 /* Kirschkeks-256x256.png in Resources */,
1C73651E1241702E5032A8A4 /* scratch.txt in Resources */, 1C73651E1241702E5032A8A4 /* scratch.txt in Resources */,
1C736E1B6330FC91332F204D /* scratch2.txt in Resources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
@ -370,9 +373,24 @@
files = ( files = (
); );
inputPaths = ( inputPaths = (
"${SRCROOT}/Pods/Target Support Files/Pods-kplayer/Pods-kplayer-frameworks.sh",
"${BUILT_PRODUCTS_DIR}/ALMoviePlayerController/ALMoviePlayerController.framework",
"${BUILT_PRODUCTS_DIR}/Alamofire/Alamofire.framework",
"${BUILT_PRODUCTS_DIR}/BMPlayer/BMPlayer.framework",
"${BUILT_PRODUCTS_DIR}/HanekeSwift/Haneke.framework",
"${BUILT_PRODUCTS_DIR}/NVActivityIndicatorView/NVActivityIndicatorView.framework",
"${BUILT_PRODUCTS_DIR}/Nimbus/Nimbus.framework",
"${BUILT_PRODUCTS_DIR}/SnapKit/SnapKit.framework",
); );
name = "[CP] Embed Pods Frameworks"; name = "[CP] Embed Pods Frameworks";
outputPaths = ( outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/ALMoviePlayerController.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Alamofire.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/BMPlayer.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Haneke.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/NVActivityIndicatorView.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Nimbus.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SnapKit.framework",
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh; shellPath = /bin/sh;
@ -385,28 +403,16 @@
files = ( files = (
); );
inputPaths = ( inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
); );
name = "[CP] Check Pods Manifest.lock"; name = "[CP] Check Pods Manifest.lock";
outputPaths = ( outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-kplayer-checkManifestLockResult.txt",
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh; shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n";
showEnvVarsInLog = 0;
};
9901417B0A169BA87853DAAE /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "[CP] Copy Pods Resources";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-kplayer/Pods-kplayer-resources.sh\"\n";
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0; showEnvVarsInLog = 0;
}; };
/* End PBXShellScriptBuildPhase section */ /* End PBXShellScriptBuildPhase section */

2
kplayer/core/MediaItem.swift

@ -120,7 +120,7 @@ class MediaItem: CustomDebugStringConvertible {
var snapshotDirPathForVideo: String { var snapshotDirPathForVideo: String {
let len = "/srv/samba/ren".count let len = "/srv/samba/ren".count
let rootPostfix = (root as NSString).substring(from: len) let rootPostfix = (root as NSString).substring(from: len)
let tpath = "/srv/samba/ren/thumb\(rootPostfix)/\(path)/\(name)"
let tpath = "/srv/samba/ren/thumb\(rootPostfix)/\(path)\(name)"
let enc = tpath.addingPercentEscapes(using: String.Encoding.isoLatin1)! let enc = tpath.addingPercentEscapes(using: String.Encoding.isoLatin1)!
return enc + "/" return enc + "/"

3
kplayer/detail/VideoPlayerController.swift

@ -103,6 +103,9 @@ print("play")
} }
@IBAction func back(_ sender: AnyObject) { @IBAction func back(_ sender: AnyObject) {
if moviePlayer!.playbackState == MPMoviePlaybackState.playing {
moviePlayer!.pause()
}
completionHandler!() completionHandler!()
} }

Loading…
Cancel
Save