Skip to content

Commit 59378c4

Browse files
committed
jikplayer-Swift Demo
1 parent 8a17fe7 commit 59378c4

82 files changed

Lines changed: 3856 additions & 133 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

ijkplayer-Swift/Podfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
PODS:
2-
- ijkplayer (0.8.2)
2+
- ijkplayer (1.0.0)
33

44
DEPENDENCIES:
55
- ijkplayer
66

77
SPEC CHECKSUMS:
8-
ijkplayer: 3b2b0c447c821b261dbe4aa8ce2041939ae11232
8+
ijkplayer: e0abdfb3d97bc126a5c40340f30f0af743679998
99

1010
PODFILE CHECKSUM: 2fc12dfafa16d9caed61985d9cebc4d4b87b20ed
1111

ijkplayer-Swift/ijkplayer-Swift.xcodeproj/project.pbxproj

Lines changed: 88 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,39 @@
88

99
/* Begin PBXBuildFile section */
1010
A2FF8741EE27E2F584FFAC40 /* Pods_ijkplayer_Swift.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CB37005FFF94F0B4ED2D08AC /* Pods_ijkplayer_Swift.framework */; };
11+
DE0756E21F4ED5520049A17A /* IJKDemoLocalFolderViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE0756E11F4ED5510049A17A /* IJKDemoLocalFolderViewController.swift */; };
12+
DE0756E41F4ED8A10049A17A /* IJKPlayerDemo.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = DE0756E31F4ED8A10049A17A /* IJKPlayerDemo.storyboard */; };
13+
DE0756E61F4ED9850049A17A /* IJKDemoSampleViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE0756E51F4ED9850049A17A /* IJKDemoSampleViewController.swift */; };
14+
DE0756E81F4F1E470049A17A /* IJKDemoInputURLViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE0756E71F4F1E470049A17A /* IJKDemoInputURLViewController.swift */; };
15+
DE0756EA1F4F21180049A17A /* IJKQRCodeScanViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE0756E91F4F21180049A17A /* IJKQRCodeScanViewController.swift */; };
16+
DE0756ED1F4F246A0049A17A /* Barcode.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE0756EC1F4F246A0049A17A /* Barcode.swift */; };
17+
DE0756F11F4FAD840049A17A /* IJKDemoHistoryItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE0756F01F4FAD840049A17A /* IJKDemoHistoryItem.swift */; };
18+
DE0756F31F4FADB20049A17A /* IJKDemoMainViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE0756F21F4FADB20049A17A /* IJKDemoMainViewController.swift */; };
19+
DE0756F51F4FC4790049A17A /* IJKMediaControl.xib in Resources */ = {isa = PBXBuildFile; fileRef = DE0756F41F4FC4790049A17A /* IJKMediaControl.xib */; };
1120
DE4070FB1F4E6A7000083127 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE4070FA1F4E6A7000083127 /* AppDelegate.swift */; };
1221
DE4070FD1F4E6A7000083127 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE4070FC1F4E6A7000083127 /* ViewController.swift */; };
1322
DE4071001F4E6A7000083127 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = DE4070FE1F4E6A7000083127 /* Main.storyboard */; };
1423
DE4071021F4E6A7000083127 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = DE4071011F4E6A7000083127 /* Assets.xcassets */; };
1524
DE4071051F4E6A7000083127 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = DE4071031F4E6A7000083127 /* LaunchScreen.storyboard */; };
25+
DE40710F1F4E8D0400083127 /* ijkplayer.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = DE40710E1F4E8D0400083127 /* ijkplayer.storyboard */; };
26+
DE40713D1F4EA44B00083127 /* ijkplayer.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = DE40713C1F4EA44B00083127 /* ijkplayer.xcassets */; };
27+
DE40713F1F4EA63200083127 /* IJKMediaControl.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE40713E1F4EA63200083127 /* IJKMediaControl.swift */; };
28+
DE4071411F4EA89F00083127 /* IJKPlayerViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE4071401F4EA89F00083127 /* IJKPlayerViewController.swift */; };
1629
/* End PBXBuildFile section */
1730

1831
/* Begin PBXFileReference section */
1932
66AA1A8010D9A357BB60A2DE /* Pods-ijkplayer-Swift.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ijkplayer-Swift.release.xcconfig"; path = "Pods/Target Support Files/Pods-ijkplayer-Swift/Pods-ijkplayer-Swift.release.xcconfig"; sourceTree = "<group>"; };
2033
6DCE7FDC06DE12FB1E4C4FE1 /* Pods-ijkplayer-Swift.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ijkplayer-Swift.debug.xcconfig"; path = "Pods/Target Support Files/Pods-ijkplayer-Swift/Pods-ijkplayer-Swift.debug.xcconfig"; sourceTree = "<group>"; };
2134
CB37005FFF94F0B4ED2D08AC /* Pods_ijkplayer_Swift.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_ijkplayer_Swift.framework; sourceTree = BUILT_PRODUCTS_DIR; };
35+
DE0756E11F4ED5510049A17A /* IJKDemoLocalFolderViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IJKDemoLocalFolderViewController.swift; sourceTree = "<group>"; };
36+
DE0756E31F4ED8A10049A17A /* IJKPlayerDemo.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = IJKPlayerDemo.storyboard; sourceTree = "<group>"; };
37+
DE0756E51F4ED9850049A17A /* IJKDemoSampleViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IJKDemoSampleViewController.swift; sourceTree = "<group>"; };
38+
DE0756E71F4F1E470049A17A /* IJKDemoInputURLViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IJKDemoInputURLViewController.swift; sourceTree = "<group>"; };
39+
DE0756E91F4F21180049A17A /* IJKQRCodeScanViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IJKQRCodeScanViewController.swift; sourceTree = "<group>"; };
40+
DE0756EC1F4F246A0049A17A /* Barcode.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Barcode.swift; sourceTree = "<group>"; };
41+
DE0756F01F4FAD840049A17A /* IJKDemoHistoryItem.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IJKDemoHistoryItem.swift; sourceTree = "<group>"; };
42+
DE0756F21F4FADB20049A17A /* IJKDemoMainViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IJKDemoMainViewController.swift; sourceTree = "<group>"; };
43+
DE0756F41F4FC4790049A17A /* IJKMediaControl.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = IJKMediaControl.xib; sourceTree = "<group>"; };
2244
DE4070F71F4E6A7000083127 /* ijkplayer-Swift.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "ijkplayer-Swift.app"; sourceTree = BUILT_PRODUCTS_DIR; };
2345
DE4070FA1F4E6A7000083127 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
2446
DE4070FC1F4E6A7000083127 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
@@ -27,6 +49,10 @@
2749
DE4071041F4E6A7000083127 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
2850
DE4071061F4E6A7000083127 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
2951
DE40710C1F4E6B2500083127 /* ijkplayer-Swift-Bridge-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "ijkplayer-Swift-Bridge-Header.h"; sourceTree = "<group>"; };
52+
DE40710E1F4E8D0400083127 /* ijkplayer.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = ijkplayer.storyboard; sourceTree = "<group>"; };
53+
DE40713C1F4EA44B00083127 /* ijkplayer.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = ijkplayer.xcassets; sourceTree = "<group>"; };
54+
DE40713E1F4EA63200083127 /* IJKMediaControl.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IJKMediaControl.swift; sourceTree = "<group>"; };
55+
DE4071401F4EA89F00083127 /* IJKPlayerViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IJKPlayerViewController.swift; sourceTree = "<group>"; };
3056
/* End PBXFileReference section */
3157

3258
/* Begin PBXFrameworksBuildPhase section */
@@ -50,6 +76,28 @@
5076
name = Pods;
5177
sourceTree = "<group>";
5278
};
79+
DE0756E01F4ED51F0049A17A /* Demo */ = {
80+
isa = PBXGroup;
81+
children = (
82+
DE0756E11F4ED5510049A17A /* IJKDemoLocalFolderViewController.swift */,
83+
DE0756E51F4ED9850049A17A /* IJKDemoSampleViewController.swift */,
84+
DE0756E71F4F1E470049A17A /* IJKDemoInputURLViewController.swift */,
85+
DE0756E91F4F21180049A17A /* IJKQRCodeScanViewController.swift */,
86+
DE0756F21F4FADB20049A17A /* IJKDemoMainViewController.swift */,
87+
DE0756E31F4ED8A10049A17A /* IJKPlayerDemo.storyboard */,
88+
);
89+
path = Demo;
90+
sourceTree = "<group>";
91+
};
92+
DE0756EB1F4F243F0049A17A /* Misc */ = {
93+
isa = PBXGroup;
94+
children = (
95+
DE0756F01F4FAD840049A17A /* IJKDemoHistoryItem.swift */,
96+
DE0756EC1F4F246A0049A17A /* Barcode.swift */,
97+
);
98+
path = Misc;
99+
sourceTree = "<group>";
100+
};
53101
DE4070EE1F4E6A7000083127 = {
54102
isa = PBXGroup;
55103
children = (
@@ -71,15 +119,38 @@
71119
DE4070F91F4E6A7000083127 /* ijkplayer-Swift */ = {
72120
isa = PBXGroup;
73121
children = (
122+
DE0756EB1F4F243F0049A17A /* Misc */,
123+
DE0756E01F4ED51F0049A17A /* Demo */,
74124
DE4070FA1F4E6A7000083127 /* AppDelegate.swift */,
75125
DE4070FC1F4E6A7000083127 /* ViewController.swift */,
76126
DE4070FE1F4E6A7000083127 /* Main.storyboard */,
127+
DE40713A1F4EA36700083127 /* Support */,
128+
DE40713B1F4EA37400083127 /* ijkplayer */,
129+
);
130+
path = "ijkplayer-Swift";
131+
sourceTree = "<group>";
132+
};
133+
DE40713A1F4EA36700083127 /* Support */ = {
134+
isa = PBXGroup;
135+
children = (
77136
DE4071011F4E6A7000083127 /* Assets.xcassets */,
78137
DE4071031F4E6A7000083127 /* LaunchScreen.storyboard */,
79138
DE4071061F4E6A7000083127 /* Info.plist */,
80139
DE40710C1F4E6B2500083127 /* ijkplayer-Swift-Bridge-Header.h */,
81140
);
82-
path = "ijkplayer-Swift";
141+
name = Support;
142+
sourceTree = "<group>";
143+
};
144+
DE40713B1F4EA37400083127 /* ijkplayer */ = {
145+
isa = PBXGroup;
146+
children = (
147+
DE40710E1F4E8D0400083127 /* ijkplayer.storyboard */,
148+
DE40713C1F4EA44B00083127 /* ijkplayer.xcassets */,
149+
DE0756F41F4FC4790049A17A /* IJKMediaControl.xib */,
150+
DE40713E1F4EA63200083127 /* IJKMediaControl.swift */,
151+
DE4071401F4EA89F00083127 /* IJKPlayerViewController.swift */,
152+
);
153+
path = ijkplayer;
83154
sourceTree = "<group>";
84155
};
85156
E41B0937ADE8F368AD5D9DD6 /* Frameworks */ = {
@@ -125,6 +196,7 @@
125196
TargetAttributes = {
126197
DE4070F61F4E6A7000083127 = {
127198
CreatedOnToolsVersion = 8.3.3;
199+
DevelopmentTeam = U42NM79F4W;
128200
ProvisioningStyle = Automatic;
129201
};
130202
};
@@ -154,7 +226,11 @@
154226
files = (
155227
DE4071051F4E6A7000083127 /* LaunchScreen.storyboard in Resources */,
156228
DE4071021F4E6A7000083127 /* Assets.xcassets in Resources */,
229+
DE0756F51F4FC4790049A17A /* IJKMediaControl.xib in Resources */,
230+
DE40710F1F4E8D0400083127 /* ijkplayer.storyboard in Resources */,
157231
DE4071001F4E6A7000083127 /* Main.storyboard in Resources */,
232+
DE40713D1F4EA44B00083127 /* ijkplayer.xcassets in Resources */,
233+
DE0756E41F4ED8A10049A17A /* IJKPlayerDemo.storyboard in Resources */,
158234
);
159235
runOnlyForDeploymentPostprocessing = 0;
160236
};
@@ -216,8 +292,17 @@
216292
isa = PBXSourcesBuildPhase;
217293
buildActionMask = 2147483647;
218294
files = (
295+
DE0756E61F4ED9850049A17A /* IJKDemoSampleViewController.swift in Sources */,
219296
DE4070FD1F4E6A7000083127 /* ViewController.swift in Sources */,
220297
DE4070FB1F4E6A7000083127 /* AppDelegate.swift in Sources */,
298+
DE0756F11F4FAD840049A17A /* IJKDemoHistoryItem.swift in Sources */,
299+
DE0756E81F4F1E470049A17A /* IJKDemoInputURLViewController.swift in Sources */,
300+
DE0756EA1F4F21180049A17A /* IJKQRCodeScanViewController.swift in Sources */,
301+
DE4071411F4EA89F00083127 /* IJKPlayerViewController.swift in Sources */,
302+
DE0756E21F4ED5520049A17A /* IJKDemoLocalFolderViewController.swift in Sources */,
303+
DE0756F31F4FADB20049A17A /* IJKDemoMainViewController.swift in Sources */,
304+
DE0756ED1F4F246A0049A17A /* Barcode.swift in Sources */,
305+
DE40713F1F4EA63200083127 /* IJKMediaControl.swift in Sources */,
221306
);
222307
runOnlyForDeploymentPostprocessing = 0;
223308
};
@@ -343,6 +428,7 @@
343428
baseConfigurationReference = 6DCE7FDC06DE12FB1E4C4FE1 /* Pods-ijkplayer-Swift.debug.xcconfig */;
344429
buildSettings = {
345430
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
431+
DEVELOPMENT_TEAM = U42NM79F4W;
346432
INFOPLIST_FILE = "ijkplayer-Swift/Info.plist";
347433
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
348434
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
@@ -358,6 +444,7 @@
358444
baseConfigurationReference = 66AA1A8010D9A357BB60A2DE /* Pods-ijkplayer-Swift.release.xcconfig */;
359445
buildSettings = {
360446
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
447+
DEVELOPMENT_TEAM = U42NM79F4W;
361448
INFOPLIST_FILE = "ijkplayer-Swift/Info.plist";
362449
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
363450
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
//
2+
// IJKDemoInputURLViewController.swift
3+
// ijkplayer-Swift
4+
//
5+
// Created by iOS Dev Log on 2017/8/24.
6+
// Copyright © 2017年 iOSDevLog. All rights reserved.
7+
//
8+
9+
import UIKit
10+
11+
class IJKDemoInputURLViewController: UIViewController, UITextViewDelegate {
12+
let rtmp = "rtmp://live.hkstv.hk.lxdns.com/live/hks"
13+
let m3u8 = "http://live.hkstv.hk.lxdns.com/live/hks/playlist.m3u8"
14+
15+
@IBOutlet weak var textView: UITextView!
16+
override func viewDidLoad() {
17+
super.viewDidLoad()
18+
19+
title = "Input URL"
20+
textView.delegate = self
21+
navigationItem.rightBarButtonItem = UIBarButtonItem(title: "Play", style: .done, target: self, action: #selector(self.onClickPlayButton))
22+
}
23+
24+
override func viewDidAppear(_ animated: Bool) {
25+
super.viewDidAppear(animated)
26+
27+
textView.text = m3u8
28+
}
29+
30+
func onClickPlayButton() {
31+
let url = URL(string: textView.text)
32+
let scheme: String? = url?.scheme?.lowercased()
33+
if (scheme == "http") || (scheme == "https") || (scheme == "rtmp") {
34+
IJKPlayerViewController.present(from: self, withTitle: "URL: \(String(describing: url))", url: url!, completion: {() -> Void in
35+
self.navigationController?.popViewController(animated: false)
36+
})
37+
}
38+
}
39+
40+
func textViewDidEndEditing(_ textView: UITextView) {
41+
onClickPlayButton()
42+
}
43+
}
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
//
2+
// IJKDemoLocalFolderViewController.swift
3+
// ijkplayer-Swift
4+
//
5+
// Created by iOS Dev Log on 2017/8/24.
6+
// Copyright © 2017年 iOSDevLog. All rights reserved.
7+
//
8+
9+
import UIKit
10+
11+
class IJKDemoLocalFolderViewController: UITableViewController {
12+
var folderPath: String = ""
13+
private var subpaths = [String]()
14+
private var files: [String]? = [String]()
15+
16+
override func viewDidLoad() {
17+
super.viewDidLoad()
18+
19+
self.folderPath = (folderPath as NSString).standardizingPath
20+
title = (folderPath as NSString).lastPathComponent
21+
subpaths = [String]()
22+
23+
var isDirectory: ObjCBool = false
24+
files = try? FileManager.default.contentsOfDirectory(atPath: folderPath)
25+
subpaths.append("..")
26+
guard files != nil else {
27+
return
28+
}
29+
for fileName: String in files! {
30+
let fullFileName: String = URL(fileURLWithPath: folderPath).appendingPathComponent(fileName).absoluteString
31+
FileManager.default.fileExists(atPath: fullFileName, isDirectory: &isDirectory)
32+
if isDirectory.boolValue {
33+
subpaths.append(fileName)
34+
}
35+
else {
36+
self.files?.append(fileName)
37+
}
38+
}
39+
}
40+
41+
override func didReceiveMemoryWarning() {
42+
super.didReceiveMemoryWarning()
43+
// Dispose of any resources that can be recreated.
44+
}
45+
46+
// MARK: - Table view data source
47+
override func numberOfSections(in tableView: UITableView) -> Int {
48+
return 2
49+
}
50+
51+
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
52+
switch section {
53+
case 0:
54+
return subpaths.count
55+
case 1:
56+
return files?.count ?? 0
57+
default:
58+
break
59+
}
60+
61+
return 0
62+
}
63+
64+
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
65+
let cell: UITableViewCell? = tableView.dequeueReusableCell(withIdentifier: "IJKDemoLocalFolderCell")
66+
cell?.textLabel?.lineBreakMode = .byTruncatingMiddle
67+
switch indexPath.section {
68+
case 0:
69+
cell?.textLabel?.text = "[\(subpaths[indexPath.row])]"
70+
cell?.accessoryType = .disclosureIndicator
71+
case 1:
72+
cell?.textLabel?.text = files?[indexPath.row]
73+
cell?.accessoryType = .none
74+
default:
75+
break
76+
}
77+
78+
return cell!
79+
}
80+
81+
override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
82+
tableView.deselectRow(at: indexPath, animated: true)
83+
switch indexPath.section {
84+
case 0:
85+
let fileName: String = URL(fileURLWithPath: folderPath).appendingPathComponent(subpaths[indexPath.row]).absoluteString
86+
87+
let viewController = self.storyboard?.instantiateViewController(withIdentifier: "IJKDemoLocalFolderViewController") as! IJKDemoLocalFolderViewController
88+
viewController.folderPath = fileName
89+
navigationController?.pushViewController(viewController, animated: true)
90+
case 1:
91+
var fileName: String = URL(fileURLWithPath: folderPath).appendingPathComponent(files![indexPath.row]).absoluteString
92+
fileName = (fileName as NSString).standardizingPath
93+
IJKPlayerViewController.present(from: self, withTitle: "File: \(fileName)", url: URL(fileURLWithPath: fileName), completion: {() -> Void in
94+
})
95+
default:
96+
break
97+
}
98+
99+
}
100+
}

0 commit comments

Comments
 (0)