Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
qq_25606643
ijkplayer
提交
1f727ea7
I
ijkplayer
项目概览
qq_25606643
/
ijkplayer
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
I
ijkplayer
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
1f727ea7
编写于
5月 27, 2015
作者:
G
Gdier
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ios: demo app support play local videos in NSDocumentDirectory.
上级
132ec911
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
210 addition
and
6 deletion
+210
-6
ios/IJKMediaDemo/IJKMediaDemo.xcodeproj/project.pbxproj
ios/IJKMediaDemo/IJKMediaDemo.xcodeproj/project.pbxproj
+8
-2
ios/IJKMediaDemo/IJKMediaDemo/IJKDemoInputURLViewController.m
...IJKMediaDemo/IJKMediaDemo/IJKDemoInputURLViewController.m
+1
-1
ios/IJKMediaDemo/IJKMediaDemo/IJKDemoLocalFolderViewController.h
...MediaDemo/IJKMediaDemo/IJKDemoLocalFolderViewController.h
+15
-0
ios/IJKMediaDemo/IJKMediaDemo/IJKDemoLocalFolderViewController.m
...MediaDemo/IJKMediaDemo/IJKDemoLocalFolderViewController.m
+169
-0
ios/IJKMediaDemo/IJKMediaDemo/IJKDemoMainViewController.m
ios/IJKMediaDemo/IJKMediaDemo/IJKDemoMainViewController.m
+17
-3
未找到文件。
ios/IJKMediaDemo/IJKMediaDemo.xcodeproj/project.pbxproj
浏览文件 @
1f727ea7
...
...
@@ -18,6 +18,7 @@
55E809F11B146C80003E98A5
/* Barcode.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
55E809F01B146C80003E98A5
/* Barcode.m */
;
};
55E809F31B146DE8003E98A5
/* IJKQRCodeScanViewController.xib in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
55E809F21B146DE8003E98A5
/* IJKQRCodeScanViewController.xib */
;
};
55E809F61B1480BC003E98A5
/* IJKDemoHistory.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
55E809F51B1480BC003E98A5
/* IJKDemoHistory.m */
;
};
55E809F91B15A1DB003E98A5
/* IJKDemoLocalFolderViewController.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
55E809F81B15A1DB003E98A5
/* IJKDemoLocalFolderViewController.m */
;
};
E60E8C2A19EF70BB005B5B6E
/* CoreMedia.framework in Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
E60E8C2919EF70BB005B5B6E
/* CoreMedia.framework */
;
};
E60FFBE418BF695700825D7F
/* libIJKMediaPlayer.a in Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
E6D74F2E18A5F94B00165BFD
/* libIJKMediaPlayer.a */
;
};
E612EAE517F7E0F800BEE660
/* MediaPlayer.framework in Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
E612EAE417F7E0F800BEE660
/* MediaPlayer.framework */
;
};
...
...
@@ -85,6 +86,8 @@
55E809F21B146DE8003E98A5
/* IJKQRCodeScanViewController.xib */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
file.xib
;
path
=
IJKQRCodeScanViewController.xib
;
sourceTree
=
"<group>"
;
};
55E809F41B1480BC003E98A5
/* IJKDemoHistory.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
IJKDemoHistory.h
;
sourceTree
=
"<group>"
;
};
55E809F51B1480BC003E98A5
/* IJKDemoHistory.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
IJKDemoHistory.m
;
sourceTree
=
"<group>"
;
};
55E809F71B15A1DB003E98A5
/* IJKDemoLocalFolderViewController.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
IJKDemoLocalFolderViewController.h
;
sourceTree
=
"<group>"
;
};
55E809F81B15A1DB003E98A5
/* IJKDemoLocalFolderViewController.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
IJKDemoLocalFolderViewController.m
;
sourceTree
=
"<group>"
;
};
E60E8C2719EF70A7005B5B6E
/* CoreAudio.framework */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
wrapper.framework
;
name
=
CoreAudio.framework
;
path
=
System/Library/Frameworks/CoreAudio.framework
;
sourceTree
=
SDKROOT
;
};
E60E8C2919EF70BB005B5B6E
/* CoreMedia.framework */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
wrapper.framework
;
name
=
CoreMedia.framework
;
path
=
System/Library/Frameworks/CoreMedia.framework
;
sourceTree
=
SDKROOT
;
};
E612EAE417F7E0F800BEE660
/* MediaPlayer.framework */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
wrapper.framework
;
name
=
MediaPlayer.framework
;
path
=
System/Library/Frameworks/MediaPlayer.framework
;
sourceTree
=
SDKROOT
;
};
...
...
@@ -155,6 +158,8 @@
E63FC27817F032FD003551EB
/* IJKCommon.h */
,
55E809EF1B146C80003E98A5
/* Barcode.h */
,
55E809F01B146C80003E98A5
/* Barcode.m */
,
55E809F41B1480BC003E98A5
/* IJKDemoHistory.h */
,
55E809F51B1480BC003E98A5
/* IJKDemoHistory.m */
,
);
name
=
Misc
;
sourceTree
=
"<group>"
;
...
...
@@ -259,8 +264,8 @@
55E809EC1B146C1E003E98A5
/* IJKQRCodeScanViewController.h */
,
55E809ED1B146C1E003E98A5
/* IJKQRCodeScanViewController.m */
,
55E809F21B146DE8003E98A5
/* IJKQRCodeScanViewController.xib */
,
55E809F
41B1480BC003E98A5
/* IJKDemoHistory
.h */
,
55E809F
51B1480BC003E98A5
/* IJKDemoHistory
.m */
,
55E809F
71B15A1DB003E98A5
/* IJKDemoLocalFolderViewController
.h */
,
55E809F
81B15A1DB003E98A5
/* IJKDemoLocalFolderViewController
.m */
,
);
name
=
"View Controllers"
;
sourceTree
=
"<group>"
;
...
...
@@ -372,6 +377,7 @@
isa
=
PBXSourcesBuildPhase
;
buildActionMask
=
2147483647
;
files
=
(
55E809F91B15A1DB003E98A5
/* IJKDemoLocalFolderViewController.m in Sources */
,
55E809F61B1480BC003E98A5
/* IJKDemoHistory.m in Sources */
,
E6903F0C17EAF70200CFD954
/* main.m in Sources */
,
55E809E21B143C47003E98A5
/* IJKDemoMainViewController.m in Sources */
,
...
...
ios/IJKMediaDemo/IJKMediaDemo/IJKDemoInputURLViewController.m
浏览文件 @
1f727ea7
...
...
@@ -37,7 +37,7 @@
if
([
scheme
isEqualToString
:
@"http"
]
||
[
scheme
isEqualToString
:
@"https"
])
{
[
IJKVideoViewController
presentFromViewController
:
self
withTitle
:[
NSString
stringWithFormat
:
@"URL: %@"
,
url
]
URL
:
url
completion
:^
{
[
self
.
navigationController
popViewControllerAnimated
:
NO
];
//
[self.navigationController popViewControllerAnimated:NO];
}];
}
}
...
...
ios/IJKMediaDemo/IJKMediaDemo/IJKDemoLocalFolderViewController.h
0 → 100644
浏览文件 @
1f727ea7
//
// IJKDemoLocalFolderViewController.h
// IJKMediaDemo
//
// Created by Gdier on 5/27/15.
// Copyright (c) 2015 bilibili. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface
IJKDemoLocalFolderViewController
:
UITableViewController
-
(
instancetype
)
initWithFolderPath
:(
NSString
*
)
folderPath
;
@end
ios/IJKMediaDemo/IJKMediaDemo/IJKDemoLocalFolderViewController.m
0 → 100644
浏览文件 @
1f727ea7
//
// IJKDemoLocalFolderViewController.m
// IJKMediaDemo
//
// Created by Gdier on 5/27/15.
// Copyright (c) 2015 bilibili. All rights reserved.
//
#import "IJKDemoLocalFolderViewController.h"
#import "IJKMoviePlayerViewController.h"
@interface
IJKDemoLocalFolderViewController
()
@end
@implementation
IJKDemoLocalFolderViewController
{
NSString
*
_folderPath
;
NSMutableArray
*
_subpaths
;
NSMutableArray
*
_files
;
}
-
(
instancetype
)
initWithFolderPath
:(
NSString
*
)
folderPath
{
self
=
[
super
init
];
if
(
self
)
{
self
.
title
=
[
folderPath
lastPathComponent
];
_folderPath
=
folderPath
;
_subpaths
=
[
NSMutableArray
array
];
_files
=
[
NSMutableArray
array
];
}
return
self
;
}
-
(
void
)
viewDidLoad
{
[
super
viewDidLoad
];
NSError
*
error
=
nil
;
BOOL
isDirectory
=
NO
;
NSArray
*
files
=
[[
NSFileManager
defaultManager
]
contentsOfDirectoryAtPath
:
_folderPath
error
:
&
error
];
for
(
NSString
*
fileName
in
files
)
{
NSString
*
fullFileName
=
[
_folderPath
stringByAppendingPathComponent
:
fileName
];
[[
NSFileManager
defaultManager
]
fileExistsAtPath
:
fullFileName
isDirectory
:
&
isDirectory
];
if
(
isDirectory
)
{
[
_subpaths
addObject
:
fileName
];
}
else
{
[
_files
addObject
:
fileName
];
}
}
}
-
(
void
)
didReceiveMemoryWarning
{
[
super
didReceiveMemoryWarning
];
// Dispose of any resources that can be recreated.
}
#pragma mark - Table view data source
-
(
NSInteger
)
numberOfSectionsInTableView
:(
UITableView
*
)
tableView
{
return
2
;
}
-
(
NSInteger
)
tableView
:(
UITableView
*
)
tableView
numberOfRowsInSection
:(
NSInteger
)
section
{
switch
(
section
)
{
case
0
:
return
_subpaths
.
count
;
case
1
:
return
_files
.
count
;
default:
break
;
}
return
0
;
}
-
(
UITableViewCell
*
)
tableView
:(
UITableView
*
)
tableView
cellForRowAtIndexPath
:(
NSIndexPath
*
)
indexPath
{
UITableViewCell
*
cell
=
[
tableView
dequeueReusableCellWithIdentifier
:
@"abc"
];
if
(
nil
==
cell
)
{
cell
=
[[
UITableViewCell
alloc
]
initWithStyle
:
UITableViewCellStyleDefault
reuseIdentifier
:
@"abc"
];
cell
.
textLabel
.
lineBreakMode
=
NSLineBreakByTruncatingMiddle
;
}
switch
(
indexPath
.
section
)
{
case
0
:
{
cell
.
textLabel
.
text
=
[
NSString
stringWithFormat
:
@"[%@]"
,
_subpaths
[
indexPath
.
row
]];
cell
.
accessoryType
=
UITableViewCellAccessoryDisclosureIndicator
;
}
break
;
case
1
:
{
cell
.
textLabel
.
text
=
_files
[
indexPath
.
row
];
cell
.
accessoryType
=
UITableViewCellAccessoryNone
;
}
break
;
default:
break
;
}
return
cell
;
}
-
(
void
)
tableView
:(
UITableView
*
)
tableView
didSelectRowAtIndexPath
:(
NSIndexPath
*
)
indexPath
{
[
tableView
deselectRowAtIndexPath
:
indexPath
animated
:
YES
];
switch
(
indexPath
.
section
)
{
case
0
:
{
NSString
*
fileName
=
[
_folderPath
stringByAppendingPathComponent
:
_subpaths
[
indexPath
.
row
]];
IJKDemoLocalFolderViewController
*
viewController
=
[[
IJKDemoLocalFolderViewController
alloc
]
initWithFolderPath
:
fileName
];
[
self
.
navigationController
pushViewController
:
viewController
animated
:
YES
];
}
break
;
case
1
:
{
NSString
*
fileName
=
[
_folderPath
stringByAppendingPathComponent
:
_files
[
indexPath
.
row
]];
[
IJKVideoViewController
presentFromViewController
:
self
withTitle
:[
NSString
stringWithFormat
:
@"File: %@"
,
fileName
]
URL
:
[
NSURL
fileURLWithPath
:
fileName
]
completion
:^
{
}];
}
break
;
default:
break
;
}
}
/*
// Override to support conditional editing of the table view.
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
// Return NO if you do not want the specified item to be editable.
return YES;
}
*/
/*
// Override to support editing the table view.
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
if (editingStyle == UITableViewCellEditingStyleDelete) {
// Delete the row from the data source
[tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade];
} else if (editingStyle == UITableViewCellEditingStyleInsert) {
// Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view
}
}
*/
/*
// Override to support rearranging the table view.
- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath {
}
*/
/*
// Override to support conditional rearranging of the table view.
- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath {
// Return NO if you do not want the item to be re-orderable.
return YES;
}
*/
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end
ios/IJKMediaDemo/IJKMediaDemo/IJKDemoMainViewController.m
浏览文件 @
1f727ea7
...
...
@@ -12,6 +12,7 @@
#import "IJKCommon.h"
#import "IJKDemoHistory.h"
#import "IJKMoviePlayerViewController.h"
#import "IJKDemoLocalFolderViewController.h"
@interface
IJKDemoMainViewController
()
<
UITableViewDataSource
,
UITableViewDelegate
>
...
...
@@ -33,6 +34,14 @@
@"Input URL"
,
@"Scan QRCode"
,
];
NSURL
*
documentsUrl
=
[[[
NSFileManager
defaultManager
]
URLsForDirectory
:
NSDocumentDirectory
inDomains
:
NSUserDomainMask
]
firstObject
];
NSError
*
error
=
nil
;
[
documentsUrl
setResourceValue
:[
NSNumber
numberWithBool
:
YES
]
forKey:
NSURLIsExcludedFromBackupKey
error:
&
error
];
}
-
(
void
)
viewWillAppear
:(
BOOL
)
animated
{
...
...
@@ -81,6 +90,7 @@
UITableViewCell
*
cell
=
[
tableView
dequeueReusableCellWithIdentifier
:
@"abc"
];
if
(
nil
==
cell
)
{
cell
=
[[
UITableViewCell
alloc
]
initWithStyle
:
UITableViewCellStyleDefault
reuseIdentifier
:
@"abc"
];
cell
.
textLabel
.
lineBreakMode
=
NSLineBreakByTruncatingMiddle
;
}
switch
(
indexPath
.
section
)
{
...
...
@@ -105,9 +115,13 @@
switch
(
indexPath
.
section
)
{
case
0
:
{
switch
(
indexPath
.
row
)
{
case
0
:
[[[
UIAlertView
alloc
]
initWithTitle
:
nil
message
:
@"TODO"
delegate
:
nil
cancelButtonTitle
:
@"Cancel"
otherButtonTitles
:
nil
]
show
];
break
;
case
0
:
{
NSString
*
documentsPath
=
[
NSSearchPathForDirectoriesInDomains
(
NSDocumentDirectory
,
NSUserDomainMask
,
YES
)
firstObject
];
IJKDemoLocalFolderViewController
*
viewController
=
[[
IJKDemoLocalFolderViewController
alloc
]
initWithFolderPath
:
documentsPath
];
[
self
.
navigationController
pushViewController
:
viewController
animated
:
YES
];
}
break
;
case
1
:
[
self
.
navigationController
pushViewController
:[[
IJKDemoInputURLViewController
alloc
]
init
]
animated
:
YES
];
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录