Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
VLC-iOS
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Sergey
VLC-iOS
Commits
b850111a
Commit
b850111a
authored
Dec 20, 2017
by
Carola Nitz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
VLCAppDelegate: play files that come from the Files App and within VLC
parent
cf7fa8ab
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
5 deletions
+12
-5
Sources/VLCAppDelegate.m
Sources/VLCAppDelegate.m
+12
-5
No files found.
Sources/VLCAppDelegate.m
View file @
b850111a
...
...
@@ -312,14 +312,21 @@ didFailToContinueUserActivityWithType:(NSString *)userActivityType
if
(
url
.
isFileURL
)
{
NSArray
*
searchPaths
=
NSSearchPathForDirectoriesInDomains
(
NSDocumentDirectory
,
NSUserDomainMask
,
YES
);
NSString
*
directoryPath
=
searchPaths
[
0
]
;
NSString
*
directoryPath
=
searchPaths
.
firstObject
;
NSURL
*
destinationURL
=
[
NSURL
fileURLWithPath
:[
NSString
stringWithFormat
:
@"%@/%@"
,
directoryPath
,
url
.
lastPathComponent
]];
NSError
*
theError
;
NSFileManager
*
manager
=
[
NSFileManager
defaultManager
];
[[
NSFileManager
defaultManager
]
moveItemAtURL
:
url
toURL
:
destinationURL
error
:&
theError
];
if
(
theError
.
code
!=
noErr
)
APLog
(
@"saving the file failed (%li): %@"
,
(
long
)
theError
.
code
,
theError
.
localizedDescription
);
[[
VLCMediaFileDiscoverer
sharedInstance
]
updateMediaList
];
NSURLRelationship
relationship
;
[
manager
getRelationship
:
&
relationship
ofDirectoryAtURL
:[
NSURL
fileURLWithPath
:
directoryPath
]
toItemAtURL
:
url
error
:&
theError
];
if
(
relationship
==
NSURLRelationshipContains
)
{
[
self
playWithURL
:
url
successCallback
:
nil
errorCallback
:
nil
];
}
}
else
if
([
url
.
scheme
isEqualToString
:
@"vlc-x-callback"
]
||
[
url
.
host
isEqualToString
:
@"x-callback-url"
])
{
// URL confirmes to the x-callback-url specification
// vlc-x-callback://x-callback-url/action?param=value&x-success=callback
...
...
@@ -345,7 +352,7 @@ didFailToContinueUserActivityWithType:(NSString *)userActivityType
errorCallback
=
[
NSURL
URLWithString
:
value
];
}
if
([
action
isEqualToString
:
@"stream"
]
&&
movieURL
)
{
[
self
playWithU
rl
:
movieURL
successCallback
:
successCallback
errorCallback
:
errorCallback
];
[
self
playWithU
RL
:
movieURL
successCallback
:
successCallback
errorCallback
:
errorCallback
];
}
else
if
([
action
isEqualToString
:
@"download"
]
&&
movieURL
)
{
[
self
downloadMovieFromURL
:
movieURL
fileNameOfMedia
:
fileName
];
...
...
@@ -380,12 +387,12 @@ didFailToContinueUserActivityWithType:(NSString *)userActivityType
if
(
cancelled
)
[
self
downloadMovieFromURL
:
url
fileNameOfMedia
:
nil
];
else
{
[
self
playWithU
rl
:
url
successCallback
:
nil
errorCallback
:
nil
];
[
self
playWithU
RL
:
url
successCallback
:
nil
errorCallback
:
nil
];
}
};
[
alert
show
];
}
else
{
[
self
playWithU
rl
:
url
successCallback
:
nil
errorCallback
:
nil
];
[
self
playWithU
RL
:
url
successCallback
:
nil
errorCallback
:
nil
];
}
}
return
YES
;
...
...
@@ -496,7 +503,7 @@ didFailToContinueUserActivityWithType:(NSString *)userActivityType
}
#pragma mark - playback
-
(
void
)
playWithU
rl
:(
NSURL
*
)
url
successCallback
:(
NSURL
*
)
successCallback
errorCallback
:(
NSURL
*
)
errorCallback
-
(
void
)
playWithU
RL
:(
NSURL
*
)
url
successCallback
:(
NSURL
*
)
successCallback
errorCallback
:(
NSURL
*
)
errorCallback
{
VLCPlaybackController
*
vpc
=
[
VLCPlaybackController
sharedInstance
];
vpc
.
fullscreenSessionRequested
=
YES
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment