Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
VideoLAN
VLC-iOS
Commits
2a9eb8b8
Commit
2a9eb8b8
authored
Dec 09, 2015
by
Felix Paul Kühne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATV ONS: implement URL deletion
parent
5a3acda9
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
67 additions
and
6 deletions
+67
-6
Apple-TV/VLCOpenNetworkStreamTVViewController.h
Apple-TV/VLCOpenNetworkStreamTVViewController.h
+2
-1
Apple-TV/VLCOpenNetworkStreamTVViewController.m
Apple-TV/VLCOpenNetworkStreamTVViewController.m
+55
-0
Apple-TV/VLCOpenNetworkStreamTVViewController.xib
Apple-TV/VLCOpenNetworkStreamTVViewController.xib
+6
-0
Apple-TV/VLCRemoteBrowsingCollectionViewController.xib
Apple-TV/VLCRemoteBrowsingCollectionViewController.xib
+2
-3
Apple-TV/VLCRemotePlaybackViewController.m
Apple-TV/VLCRemotePlaybackViewController.m
+0
-2
SharedSources/CAAnimation+VLCWiggle.h
SharedSources/CAAnimation+VLCWiggle.h
+2
-0
No files found.
Apple-TV/VLCOpenNetworkStreamTVViewController.h
View file @
2a9eb8b8
...
...
@@ -10,8 +10,9 @@
*****************************************************************************/
#import <UIKit/UIKit.h>
#import "VLCDeletionCapableViewController.h"
@interface
VLCOpenNetworkStreamTVViewController
:
UI
ViewController
<
UITableViewDataSource
,
UITableViewDelegate
>
@interface
VLCOpenNetworkStreamTVViewController
:
VLCDeletionCapable
ViewController
<
UITableViewDataSource
,
UITableViewDelegate
>
@property
(
readwrite
,
nonatomic
,
weak
)
IBOutlet
UITextField
*
playURLField
;
@property
(
readwrite
,
nonatomic
,
weak
)
IBOutlet
UITableView
*
previouslyPlayedStreamsTableView
;
...
...
Apple-TV/VLCOpenNetworkStreamTVViewController.m
View file @
2a9eb8b8
...
...
@@ -13,12 +13,14 @@
#import "VLCPlaybackController.h"
#import "VLCPlayerDisplayController.h"
#import "VLCFullscreenMovieTVViewController.h"
#import "CAAnimation+VLCWiggle.h"
@interface
VLCOpenNetworkStreamTVViewController
()
{
NSMutableArray
*
_recentURLs
;
UILabel
*
_noURLsToShowLabel
;
}
@property
(
nonatomic
)
NSIndexPath
*
currentlyFocusedIndexPath
;
@end
@implementation
VLCOpenNetworkStreamTVViewController
...
...
@@ -121,6 +123,11 @@
return
_recentURLs
.
count
;
}
-
(
void
)
tableView
:(
UITableView
*
)
tableView
didHighlightRowAtIndexPath
:(
NSIndexPath
*
)
indexPath
{
self
.
currentlyFocusedIndexPath
=
indexPath
;
}
-
(
NSInteger
)
numberOfSectionsInTableView
:(
UITableView
*
)
tableView
{
return
1
;
...
...
@@ -151,4 +158,52 @@
completion:
nil
];
}
#pragma mark - editing
-
(
NSIndexPath
*
)
indexPathToDelete
{
NSIndexPath
*
indexPathToDelete
=
self
.
currentlyFocusedIndexPath
;
return
indexPathToDelete
;
}
-
(
NSString
*
)
itemToDelete
{
NSIndexPath
*
indexPathToDelete
=
self
.
indexPathToDelete
;
if
(
!
indexPathToDelete
)
{
return
nil
;
}
NSString
*
ret
;
@synchronized
(
_recentURLs
)
{
ret
=
_recentURLs
[
indexPathToDelete
.
item
];
}
return
ret
;
}
-
(
void
)
setEditing
:(
BOOL
)
editing
{
[
super
setEditing
:
editing
];
UITableViewCell
*
focusedCell
=
[
self
.
previouslyPlayedStreamsTableView
cellForRowAtIndexPath
:
self
.
currentlyFocusedIndexPath
];
if
(
editing
)
{
[
focusedCell
.
layer
addAnimation
:[
CAAnimation
vlc_wiggleAnimation
]
forKey:
VLCWiggleAnimationKey
];
}
else
{
[
focusedCell
.
layer
removeAnimationForKey
:
VLCWiggleAnimationKey
];
}
}
-
(
void
)
deleteFileAtIndex
:(
NSIndexPath
*
)
indexPathToDelete
{
if
(
!
indexPathToDelete
)
{
return
;
}
@synchronized
(
_recentURLs
)
{
[
_recentURLs
removeObjectAtIndex
:
indexPathToDelete
.
row
];
}
[[
NSUbiquitousKeyValueStore
defaultStore
]
setArray
:
_recentURLs
forKey
:
kVLCRecentURLs
];
[
self
.
previouslyPlayedStreamsTableView
reloadData
];
}
@end
Apple-TV/VLCOpenNetworkStreamTVViewController.xib
View file @
2a9eb8b8
...
...
@@ -6,6 +6,7 @@
<objects>
<placeholder
placeholderIdentifier=
"IBFilesOwner"
id=
"-1"
userLabel=
"File's Owner"
customClass=
"VLCOpenNetworkStreamTVViewController"
>
<connections>
<outlet
property=
"deleteHintView"
destination=
"Wa3-IS-ztU"
id=
"ipW-Hx-fMJ"
/>
<outlet
property=
"playURLField"
destination=
"dWa-3n-YCa"
id=
"Eoe-vT-AuM"
/>
<outlet
property=
"preferredFocusedView"
destination=
"dWa-3n-YCa"
id=
"0Ez-4Z-KFF"
/>
<outlet
property=
"previouslyPlayedStreamsTableView"
destination=
"v0o-s0-Xaz"
id=
"I1r-ie-lFf"
/>
...
...
@@ -40,9 +41,14 @@
<outlet
property=
"delegate"
destination=
"-1"
id=
"osW-Kv-1VK"
/>
</connections>
</tableView>
<view
hidden=
"YES"
contentMode=
"scaleToFill"
placeholderIntrinsicWidth=
"550"
placeholderIntrinsicHeight=
"100"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"Wa3-IS-ztU"
customClass=
"VLCDeleteHintTVView"
>
<rect
key=
"frame"
x=
"685"
y=
"930"
width=
"550"
height=
"100"
/>
</view>
</subviews>
<constraints>
<constraint
firstItem=
"Wa3-IS-ztU"
firstAttribute=
"centerX"
secondItem=
"iN0-l3-epB"
secondAttribute=
"centerX"
id=
"0ms-Lt-g1Q"
/>
<constraint
firstItem=
"dWa-3n-YCa"
firstAttribute=
"top"
secondItem=
"iN0-l3-epB"
secondAttribute=
"top"
constant=
"193"
id=
"6FP-0U-Znd"
/>
<constraint
firstAttribute=
"bottom"
secondItem=
"Wa3-IS-ztU"
secondAttribute=
"bottom"
constant=
"50"
id=
"ZDa-1f-46j"
/>
<constraint
firstItem=
"v0o-s0-Xaz"
firstAttribute=
"centerX"
secondItem=
"iN0-l3-epB"
secondAttribute=
"centerX"
id=
"elq-bO-Tb3"
/>
<constraint
firstItem=
"v0o-s0-Xaz"
firstAttribute=
"top"
secondItem=
"dWa-3n-YCa"
secondAttribute=
"bottom"
constant=
"70"
id=
"jCe-Gz-82c"
/>
<constraint
firstItem=
"dWa-3n-YCa"
firstAttribute=
"centerX"
secondItem=
"iN0-l3-epB"
secondAttribute=
"centerX"
id=
"oFS-xp-QJo"
/>
...
...
Apple-TV/VLCRemoteBrowsingCollectionViewController.xib
View file @
2a9eb8b8
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document
type=
"com.apple.InterfaceBuilder.AppleTV.XIB"
version=
"3.0"
toolsVersion=
"9
059
"
systemVersion=
"15B42"
targetRuntime=
"AppleTV"
propertyAccessControl=
"none"
useAutolayout=
"YES"
>
<document
type=
"com.apple.InterfaceBuilder.AppleTV.XIB"
version=
"3.0"
toolsVersion=
"9
531
"
systemVersion=
"15B42"
targetRuntime=
"AppleTV"
propertyAccessControl=
"none"
useAutolayout=
"YES"
>
<dependencies>
<plugIn
identifier=
"com.apple.InterfaceBuilder.IBCocoaTouchPlugin"
version=
"9
04
9"
/>
<plugIn
identifier=
"com.apple.InterfaceBuilder.IBCocoaTouchPlugin"
version=
"9
52
9"
/>
</dependencies>
<objects>
<placeholder
placeholderIdentifier=
"IBFilesOwner"
id=
"-1"
userLabel=
"File's Owner"
customClass=
"VLCRemoteBrowsingCollectionViewController"
>
...
...
@@ -15,7 +15,6 @@
<collectionView
clipsSubviews=
"YES"
multipleTouchEnabled=
"YES"
contentMode=
"scaleToFill"
dataMode=
"none"
id=
"NUi-8f-W1D"
>
<rect
key=
"frame"
x=
"0.0"
y=
"0.0"
width=
"1920"
height=
"1080"
/>
<autoresizingMask
key=
"autoresizingMask"
flexibleMaxX=
"YES"
flexibleMaxY=
"YES"
/>
<animations/>
<collectionViewFlowLayout
key=
"collectionViewLayout"
minimumLineSpacing=
"100"
minimumInteritemSpacing=
"50"
id=
"o9k-mG-llf"
>
<size
key=
"itemSize"
width=
"308"
height=
"308"
/>
<size
key=
"headerReferenceSize"
width=
"0.0"
height=
"0.0"
/>
...
...
Apple-TV/VLCRemotePlaybackViewController.m
View file @
2a9eb8b8
...
...
@@ -20,8 +20,6 @@
#define remotePlaybackReuseIdentifer @"remotePlaybackReuseIdentifer"
static
NSString
*
const
VLCWiggleAnimationKey
=
@"VLCWiggleAnimation"
;
@interface
VLCRemotePlaybackViewController
()
<
UICollectionViewDataSource
,
UICollectionViewDelegate
,
VLCMediaFileDiscovererDelegate
>
{
Reachability
*
_reachability
;
...
...
SharedSources/CAAnimation+VLCWiggle.h
View file @
2a9eb8b8
...
...
@@ -11,6 +11,8 @@
#import <QuartzCore/QuartzCore.h>
static
NSString
*
const
VLCWiggleAnimationKey
=
@"VLCWiggleAnimation"
;
@interface
CAAnimation
(
VLCWiggle
)
+
(
instancetype
)
vlc_wiggleAnimation
;
@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