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
311
Issues
311
List
Boards
Labels
Service Desk
Milestones
Merge Requests
6
Merge Requests
6
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
VideoLAN
VLC-iOS
Commits
ea17df6a
Commit
ea17df6a
authored
May 10, 2014
by
Carola Nitz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
GDrive: added streaming
parent
423eda37
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
3 deletions
+19
-3
Sources/VLCGoogleDriveController.h
Sources/VLCGoogleDriveController.h
+1
-0
Sources/VLCGoogleDriveController.m
Sources/VLCGoogleDriveController.m
+8
-0
Sources/VLCGoogleDriveTableViewController.m
Sources/VLCGoogleDriveTableViewController.m
+10
-3
No files found.
Sources/VLCGoogleDriveController.h
View file @
ea17df6a
...
...
@@ -40,6 +40,7 @@
-
(
void
)
logout
;
-
(
void
)
requestDirectoryListingWithFolderId
:(
NSString
*
)
folderId
;
-
(
BOOL
)
hasMoreFiles
;
-
(
void
)
streamFile
:(
GTLDriveFile
*
)
file
;
-
(
void
)
downloadFileToDocumentFolder
:(
GTLDriveFile
*
)
file
;
@end
Sources/VLCGoogleDriveController.m
View file @
ea17df6a
...
...
@@ -147,6 +147,14 @@
}];
}
-
(
void
)
streamFile
:(
GTLDriveFile
*
)
file
{
VLCAppDelegate
*
appDelegate
=
(
VLCAppDelegate
*
)[
UIApplication
sharedApplication
].
delegate
;
NSString
*
token
=
((
GTMOAuth2Authentication
*
)
self
.
driveService
.
authorizer
).
accessToken
;
NSString
*
downloadString
=
[
file
.
downloadUrl
stringByAppendingString
:[
NSString
stringWithFormat
:
@"&access_token=%@"
,
token
]];
[
appDelegate
openMovieFromURL
:[
NSURL
URLWithString
:
downloadString
]];
}
-
(
void
)
_triggerNextDownload
{
if
(
_listOfGoogleDriveFilesToDownload
.
count
>
0
&&
!
_downloadInProgress
)
{
...
...
Sources/VLCGoogleDriveTableViewController.m
View file @
ea17df6a
...
...
@@ -214,7 +214,6 @@
cell
=
[
VLCCloudStorageTableViewCell
cellWithReuseIdentifier
:
CellIdentifier
];
cell
.
driveFile
=
_googleDriveController
.
currentListFiles
[
indexPath
.
row
];
cell
.
downloadButton
.
hidden
=
YES
;
cell
.
delegate
=
self
;
return
cell
;
...
...
@@ -231,8 +230,7 @@
{
_selectedFile
=
_googleDriveController
.
currentListFiles
[
indexPath
.
row
];
if
(
!
[
_selectedFile
.
mimeType
isEqualToString
:
@"application/vnd.google-apps.folder"
])
{
UIAlertView
*
alert
=
[[
UIAlertView
alloc
]
initWithTitle
:
NSLocalizedString
(
@"DROPBOX_DOWNLOAD"
,
@""
)
message
:[
NSString
stringWithFormat
:
NSLocalizedString
(
@"DROPBOX_DL_LONG"
,
@""
),
_selectedFile
.
title
,
[[
UIDevice
currentDevice
]
model
]]
delegate
:
self
cancelButtonTitle
:
NSLocalizedString
(
@"BUTTON_CANCEL"
,
@""
)
otherButtonTitles
:
NSLocalizedString
(
@"BUTTON_DOWNLOAD"
,
@""
),
nil
];
[
alert
show
];
[
_googleDriveController
streamFile
:
_selectedFile
];
}
else
{
/* dive into subdirectory */
if
(
!
[
_currentFolderId
isEqualToString
:
@""
])
...
...
@@ -243,6 +241,15 @@
[
self
.
tableView
deselectRowAtIndexPath
:
indexPath
animated
:
NO
];
}
-
(
void
)
triggerDownloadForCell
:(
VLCCloudStorageTableViewCell
*
)
cell
{
_selectedFile
=
_googleDriveController
.
currentListFiles
[[
self
.
tableView
indexPathForCell
:
cell
].
row
];
/* selected item is a proper file, ask the user if s/he wants to download it */
UIAlertView
*
alert
=
[[
UIAlertView
alloc
]
initWithTitle
:
NSLocalizedString
(
@"DROPBOX_DOWNLOAD"
,
@""
)
message
:[
NSString
stringWithFormat
:
NSLocalizedString
(
@"DROPBOX_DL_LONG"
,
@""
),
_selectedFile
.
title
,
[[
UIDevice
currentDevice
]
model
]]
delegate
:
self
cancelButtonTitle
:
NSLocalizedString
(
@"BUTTON_CANCEL"
,
@""
)
otherButtonTitles
:
NSLocalizedString
(
@"BUTTON_DOWNLOAD"
,
@""
),
nil
];
[
alert
show
];
}
-
(
void
)
scrollViewDidScroll
:(
UIScrollView
*
)
scrollView
{
NSInteger
currentOffset
=
scrollView
.
contentOffset
.
y
;
...
...
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