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
310
Issues
310
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
86c9d004
Commit
86c9d004
authored
May 20, 2013
by
Felix Paul Kühne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Limit HTTP upload server to available WiFi networking
parent
91fcd6df
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
34 additions
and
3 deletions
+34
-3
AspenProject/VLCAddMediaViewController.m
AspenProject/VLCAddMediaViewController.m
+31
-3
AspenProject/VLCPlaylistViewController.m
AspenProject/VLCPlaylistViewController.m
+3
-0
Resources/de.lproj/Localizable.strings
Resources/de.lproj/Localizable.strings
+0
-0
Resources/en.lproj/Localizable.strings
Resources/en.lproj/Localizable.strings
+0
-0
Resources/fr.lproj/Localizable.strings
Resources/fr.lproj/Localizable.strings
+0
-0
Resources/ru.lproj/Localizable.strings
Resources/ru.lproj/Localizable.strings
+0
-0
No files found.
AspenProject/VLCAddMediaViewController.m
View file @
86c9d004
...
...
@@ -14,12 +14,14 @@
#import "VLCHTTPUploaderController.h"
#import "VLCSettingsViewController.h"
#import "HTTPServer.h"
#import "Reachability.h"
#import <ifaddrs.h>
#import <arpa/inet.h>
@interface
VLCAddMediaViewController
()
{
VLCHTTPUploaderController
*
_uploadController
;
Reachability
*
_reachability
;
}
@end
...
...
@@ -33,6 +35,12 @@
return
self
;
}
-
(
void
)
dealloc
{
[
_reachability
stopNotifier
];
[[
NSNotificationCenter
defaultCenter
]
removeObserver
:
self
];
}
-
(
void
)
viewDidLoad
{
[
super
viewDidLoad
];
...
...
@@ -43,6 +51,25 @@
[
self
.
openNetworkStreamButton
setTitle
:
NSLocalizedString
(
@"OPEN_NETWORK"
,
@""
)
forState
:
UIControlStateNormal
];
[
self
.
downloadFromHTTPServerButton
setTitle
:
NSLocalizedString
(
@"DOWNLOAD_FROM_HTTP"
,
@""
)
forState
:
UIControlStateNormal
];
[
self
.
openURLButton
setTitle
:
NSLocalizedString
(
@"BUTTON_OPEN"
,
@""
)
forState
:
UIControlStateNormal
];
_reachability
=
[
Reachability
reachabilityForLocalWiFi
];
[
_reachability
startNotifier
];
[
self
netReachabilityChanged
:
nil
];
[[
NSNotificationCenter
defaultCenter
]
addObserver
:
self
selector
:
@selector
(
netReachabilityChanged
:
)
name
:
kReachabilityChangedNotification
object
:
nil
];
}
-
(
void
)
netReachabilityChanged
:(
NSNotification
*
)
notification
{
if
(
_reachability
.
currentReachabilityStatus
==
ReachableViaWiFi
)
{
self
.
httpUploadServerSwitch
.
enabled
=
YES
;
self
.
httpUploadServerLocationLabel
.
text
=
NSLocalizedString
(
@"HTTP_UPLOAD_SERVER_OFF"
,
@""
);
}
else
{
self
.
httpUploadServerSwitch
.
enabled
=
NO
;
self
.
httpUploadServerSwitch
.
on
=
NO
;
self
.
httpUploadServerLocationLabel
.
text
=
NSLocalizedString
(
@"HTTP_UPLOAD_NO_CONNECTIVITY"
,
@""
);
}
}
-
(
void
)
viewWillAppear
:(
BOOL
)
animated
...
...
@@ -50,6 +77,7 @@
[
self
.
openURLButton
sizeToFit
];
if
(
self
.
openURLView
.
superview
)
[
self
.
openURLView
removeFromSuperview
];
[
super
viewWillAppear
:
animated
];
}
...
...
@@ -81,7 +109,7 @@
-
(
IBAction
)
openNetworkStream
:(
id
)
sender
{
if
(
sender
==
self
.
openNetworkStreamButton
)
{
if
([[
UIPasteboard
generalPasteboard
]
containsPasteboardTypes
:
[
NSArray
arrayWithObjects
:
@"public.url"
,
@"public.text"
,
nil
]])
{
if
([[
UIPasteboard
generalPasteboard
]
containsPasteboardTypes
:
@[
@"public.url"
,
@"public.text"
]])
{
NSURL
*
pasteURL
=
[[
UIPasteboard
generalPasteboard
]
valueForPasteboardType
:
@"public.url"
];
if
(
!
pasteURL
||
[[
pasteURL
absoluteString
]
isEqualToString
:
@""
])
{
NSString
*
pasteString
=
[[
UIPasteboard
generalPasteboard
]
valueForPasteboardType
:
@"public.text"
];
...
...
@@ -127,8 +155,8 @@
temp_addr
=
interfaces
;
while
(
temp_addr
!=
NULL
)
{
if
(
temp_addr
->
ifa_addr
->
sa_family
==
AF_INET
)
{
if
([
[
NSString
stringWithUTF8String
:
temp_addr
->
ifa_name
]
isEqualToString
:
@"en0"
])
address
=
[
NSString
stringWithUTF8String
:
inet_ntoa
(((
struct
sockaddr_in
*
)
temp_addr
->
ifa_addr
)
->
sin_addr
)]
;
if
([
@
(
temp_addr
->
ifa_name
)
isEqualToString
:
@"en0"
])
address
=
@
(
inet_ntoa
(((
struct
sockaddr_in
*
)
temp_addr
->
ifa_addr
)
->
sin_addr
))
;
}
temp_addr
=
temp_addr
->
ifa_next
;
}
...
...
AspenProject/VLCPlaylistViewController.m
View file @
86c9d004
...
...
@@ -272,6 +272,9 @@
/* deprecated in iOS 6 */
-
(
BOOL
)
shouldAutorotateToInterfaceOrientation
:(
UIInterfaceOrientation
)
toInterfaceOrientation
{
if
(
UIInterfaceOrientationIsPortrait
(
toInterfaceOrientation
))
return
YES
;
if
(
_foundMedia
.
count
>
0
)
return
YES
;
else
...
...
Resources/de.lproj/Localizable.strings
View file @
86c9d004
B
"CHOOSE_AUDIO_TRACK"="Audiospur wählen";
...
...
Resources/en.lproj/Localizable.strings
View file @
86c9d004
B
"CHOOSE_AUDIO_TRACK"="Choose Audio Track";
...
...
Resources/fr.lproj/Localizable.strings
View file @
86c9d004
B
"CHOOSE_AUDIO_TRACK"="Choisir Piste Audio";
...
...
Resources/ru.lproj/Localizable.strings
View file @
86c9d004
B
"CHOOSE_AUDIO_TRACK"="Выберите аудио поток";
...
...
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