Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
VideoLAN
VLC-iOS
Commits
9445e28f
Commit
9445e28f
authored
Oct 21, 2015
by
Felix Paul Kühne
Browse files
VLCDropboxController: add support for ATV
parent
6da09337
Changes
2
Hide whitespace changes
Inline
Side-by-side
Sources/VLCDropboxController.h
View file @
9445e28f
...
...
@@ -10,7 +10,11 @@
* Refer to the COPYING file of the official project for license.
*****************************************************************************/
#if TARGET_OS_IOS
#import <DropboxSDK/DropboxSDK.h>
#else
#import <DropboxTVSDK/DropboxSDK.h>
#endif
#import "VLCCloudStorageController.h"
@interface
VLCDropboxController
:
VLCCloudStorageController
<
DBRestClientDelegate
,
DBSessionDelegate
,
DBNetworkRequestDelegate
>
...
...
Sources/VLCDropboxController.m
View file @
9445e28f
...
...
@@ -14,8 +14,12 @@
#import "VLCDropboxController.h"
#import "NSString+SupportedMedia.h"
#import "VLCPlaybackController.h"
#if TARGET_OS_TV
#import "VLCPlayerDisplayController.h"
#else
#import "VLCActivityManager.h"
#import "VLCMediaFileDiscoverer.h"
#endif
@interface
VLCDropboxController
()
{
...
...
@@ -163,6 +167,7 @@
-
(
void
)
restClient
:(
DBRestClient
*
)
client
loadedFile
:(
NSString
*
)
localPath
{
#if TARGET_OS_IOS
/* update library now that we got a file */
[[
VLCMediaFileDiscoverer
sharedInstance
]
performSelectorOnMainThread
:
@selector
(
updateMediaList
)
withObject
:
nil
waitUntilDone
:
NO
];
...
...
@@ -171,6 +176,7 @@
_downloadInProgress
=
NO
;
[
self
_triggerNextDownload
];
#endif
}
-
(
void
)
restClient
:(
DBRestClient
*
)
client
loadFileFailedWithError
:(
NSError
*
)
error
...
...
@@ -217,21 +223,25 @@
-
(
void
)
networkRequestStarted
{
_outstandingNetworkRequests
++
;
#if TARGET_OS_IOS
if
(
_outstandingNetworkRequests
==
1
)
{
VLCActivityManager
*
activityManager
=
[
VLCActivityManager
defaultManager
];
[
activityManager
networkActivityStarted
];
[
activityManager
disableIdleTimer
];
}
#endif
}
-
(
void
)
networkRequestStopped
{
_outstandingNetworkRequests
--
;
#if TARGET_OS_IOS
if
(
_outstandingNetworkRequests
==
0
)
{
VLCActivityManager
*
activityManager
=
[
VLCActivityManager
defaultManager
];
[
activityManager
networkActivityStopped
];
[
activityManager
activateIdleTimer
];
}
#endif
}
#pragma mark - VLC internal communication and delegate
...
...
@@ -270,12 +280,27 @@
#pragma mark - user feedback
-
(
void
)
_handleError
:(
NSError
*
)
error
{
#if TARGET_OS_IOS
VLCAlertView
*
alert
=
[[
VLCAlertView
alloc
]
initWithTitle
:[
NSString
stringWithFormat
:
NSLocalizedString
(
@"ERROR_NUMBER"
,
nil
),
error
.
code
]
message:
error
.
localizedDescription
delegate:
self
cancelButtonTitle:
NSLocalizedString
(
@"BUTTON_CANCEL"
,
nil
)
otherButtonTitles:
nil
];
[
alert
show
];
#else
UIAlertController
*
alert
=
[
UIAlertController
alertControllerWithTitle
:[
NSString
stringWithFormat
:
NSLocalizedString
(
@"ERROR_NUMBER"
,
nil
),
error
.
code
]
message:
error
.
localizedDescription
preferredStyle:
UIAlertControllerStyleAlert
];
UIAlertAction
*
defaultAction
=
[
UIAlertAction
actionWithTitle
:
NSLocalizedString
(
@"BUTTON_CANCEL"
,
nil
)
style:
UIAlertActionStyleDestructive
handler:
^
(
UIAlertAction
*
action
)
{
}];
[
alert
addAction
:
defaultAction
];
[[[
VLCPlayerDisplayController
sharedInstance
]
childViewController
]
presentViewController
:
alert
animated
:
YES
completion
:
nil
];
#endif
}
@end
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