Commit eb12ad4a authored by Pierre SAGASPE's avatar Pierre SAGASPE Committed by Felix Paul Kühne

add toggle switch to scan external subtitle over http

Signed-off-by: Felix Paul Kühne's avatarFelix Paul Kühne <fkuehne@videolan.org>
parent e815b746
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="5037" systemVersion="12F45" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="5056" systemVersion="13C64" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
<dependencies>
<deployment defaultVersion="1552" identifier="iOS"/>
<development version="5000" identifier="xcode"/>
......@@ -8,6 +8,8 @@
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="VLCOpenNetworkStreamViewController">
<connections>
<outlet property="ScanSubModeLabel" destination="Ewx-Hn-7Lc" id="Mfo-2x-j1h"/>
<outlet property="ScanSubToggleSwitch" destination="nCb-2V-ulT" id="5s3-DJ-mwc"/>
<outlet property="historyTableView" destination="10" id="15"/>
<outlet property="openButton" destination="i2a-FY-QGC" id="ry8-BI-sW5"/>
<outlet property="privateModeLabel" destination="9" id="13"/>
......@@ -77,8 +79,29 @@
<color key="backgroundColor" red="0.1215686275" green="0.1215686275" blue="0.1215686275" alpha="1" colorSpace="calibratedRGB"/>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
</view>
<view contentMode="scaleToFill" id="Cuf-mI-ZuN">
<rect key="frame" x="0.0" y="184" width="320" height="51"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
<subviews>
<switch opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" id="nCb-2V-ulT">
<rect key="frame" x="20" y="10" width="51" height="31"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="onTintColor" white="0.0" alpha="0.60999999999999999" colorSpace="custom" customColorSpace="calibratedWhite"/>
</switch>
<label clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Scan Subtitle" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="Ewx-Hn-7Lc" userLabel="Label - Scan Subtitle">
<rect key="frame" x="77" y="10" width="205" height="31"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" red="0.1215686275" green="0.1215686275" blue="0.1215686275" alpha="1" colorSpace="calibratedRGB"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" red="0.74659199620000005" green="0.74659199620000005" blue="0.74659199620000005" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" red="0.1215686275" green="0.1215686275" blue="0.1215686275" alpha="1" colorSpace="calibratedRGB"/>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
</view>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" showsVerticalScrollIndicator="NO" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" id="10">
<rect key="frame" x="0.0" y="186" width="320" height="197"/>
<rect key="frame" x="0.0" y="238" width="320" height="145"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" red="0.1215686275" green="0.1215686275" blue="0.1215686275" alpha="1" colorSpace="calibratedRGB"/>
<color key="separatorColor" white="0.0" alpha="0.60999999999999999" colorSpace="custom" customColorSpace="calibratedWhite"/>
......
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="5037" systemVersion="12F45" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="5056" systemVersion="13C64" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
<dependencies>
<deployment defaultVersion="1552" identifier="iOS"/>
<development version="5000" identifier="xcode"/>
......@@ -8,6 +8,8 @@
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="VLCOpenNetworkStreamViewController">
<connections>
<outlet property="ScanSubModeLabel" destination="4US-Eh-YJy" id="KE8-LR-RYj"/>
<outlet property="ScanSubToggleSwitch" destination="uJe-rZ-Pcw" id="oh9-sW-jn8"/>
<outlet property="historyTableView" destination="10" id="15"/>
<outlet property="openButton" destination="7" id="14"/>
<outlet property="privateModeLabel" destination="9" id="13"/>
......@@ -80,8 +82,29 @@
<color key="backgroundColor" red="0.1215686275" green="0.1215686275" blue="0.1215686275" alpha="1" colorSpace="calibratedRGB"/>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
</view>
<view contentMode="scaleToFill" id="fFR-hG-wOE">
<rect key="frame" x="0.0" y="162" width="320" height="60"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
<subviews>
<switch opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" id="uJe-rZ-Pcw">
<rect key="frame" x="10" y="16" width="51" height="31"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="onTintColor" white="0.0" alpha="0.60999999999999999" colorSpace="custom" customColorSpace="calibratedWhite"/>
</switch>
<label clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Scan Sub" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="4US-Eh-YJy">
<rect key="frame" x="99" y="16" width="205" height="31"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" red="0.1215686275" green="0.1215686275" blue="0.1215686275" alpha="1" colorSpace="calibratedRGB"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" red="0.74659199620000005" green="0.74659199620000005" blue="0.74659199620000005" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" red="0.1215686275" green="0.1215686275" blue="0.1215686275" alpha="1" colorSpace="calibratedRGB"/>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
</view>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" showsVerticalScrollIndicator="NO" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" id="10">
<rect key="frame" x="0.0" y="165" width="320" height="218"/>
<rect key="frame" x="0.0" y="230" width="320" height="153"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" red="0.1215686275" green="0.1215686275" blue="0.1215686275" alpha="1" colorSpace="calibratedRGB"/>
<color key="separatorColor" white="0.0" alpha="0.60999999999999999" colorSpace="custom" customColorSpace="calibratedWhite"/>
......
B"CHOOSE_AUDIO_TRACK"="Choose Audio Track";
......
B"CHOOSE_AUDIO_TRACK"="Choisir la piste audio";
......
......@@ -34,6 +34,7 @@
#define kVLCSettingSubtitlesBoldFontDefaulValue @NO
#define kVLCSettingSubtitlesFontColor @"quartztext-color"
#define kVLCSettingSubtitlesFontColorDefaultValue @"16777215"
#define kVLCSettingSubtitlesFilePath @"sub-file"
#define kVLCSettingDeinterlace @"deinterlace"
#define kVLCSettingDeinterlaceDefaultValue @(0)
#define kVLCSettingNetworkCaching @"network-caching"
......@@ -47,6 +48,7 @@
#define kVLCShowRemainingTime @"show-remaining-time"
#define kVLCRecentURLs @"recent-urls"
#define kVLCPrivateWebStreaming @"private-streaming"
#define kVLChttpScanSubtitle @"http-scan-subtitle"
#define kVLCFTPServer @"ftp-server"
#define kVLCFTPLogin @"ftp-login"
......
......@@ -412,8 +412,10 @@
[self _stopPlayback];
return;
}
_listPlayer = [[VLCMediaListPlayer alloc] init];
if (self.pathToExternalSubtitlesFile)
_listPlayer = [[VLCMediaListPlayer alloc] initWithOptions:@[[NSString stringWithFormat:@"--%@=%@", kVLCSettingSubtitlesFilePath, self.pathToExternalSubtitlesFile]]];
else
_listPlayer = [[VLCMediaListPlayer alloc] init];
_mediaPlayer = _listPlayer.mediaPlayer;
[_mediaPlayer setDelegate:self];
......
......@@ -16,7 +16,9 @@
@property (strong, nonatomic) IBOutlet UITextField *urlField;
@property (strong, nonatomic) IBOutlet UIButton *openButton;
@property (strong, nonatomic) IBOutlet UISwitch *privateToggleSwitch;
@property (strong, nonatomic) IBOutlet UISwitch *ScanSubToggleSwitch;
@property (strong, nonatomic) IBOutlet UILabel *privateModeLabel;
@property (strong, nonatomic) IBOutlet UILabel *ScanSubModeLabel;
@property (strong, nonatomic) IBOutlet UITableView *historyTableView;
@property (strong, nonatomic) IBOutlet UILabel *whatToOpenHelpLabel;
......
......@@ -45,6 +45,9 @@
else
[self.openButton setTitle:NSLocalizedString(@"BUTTON_OPEN", @"") forState:UIControlStateNormal];
[self.privateModeLabel setText:NSLocalizedString(@"PRIVATE_PLAYBACK_TOGGLE", @"")];
[self.ScanSubModeLabel setText:NSLocalizedString(@"SCAN_SUBTITLE_TOGGLE", @"")];
[self.ScanSubModeLabel setAdjustsFontSizeToFitWidth:YES];
[self.ScanSubModeLabel setNumberOfLines:0];
self.title = NSLocalizedString(@"OPEN_NETWORK", @"");
self.navigationItem.leftBarButtonItem = [UIBarButtonItem themedRevealMenuButtonWithTarget:self andSelector:@selector(goBack:)];
[self.whatToOpenHelpLabel setText:NSLocalizedString(@"OPEN_NETWORK_HELP", @"")];
......@@ -71,6 +74,7 @@
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
_recentURLs = [NSMutableArray arrayWithArray:[defaults objectForKey:kVLCRecentURLs]];
self.privateToggleSwitch.on = [defaults boolForKey:kVLCPrivateWebStreaming];
self.ScanSubToggleSwitch.on = [defaults boolForKey:kVLChttpScanSubtitle];
[super viewWillAppear:animated];
}
......@@ -80,6 +84,7 @@
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
[defaults setObject:[NSArray arrayWithArray:_recentURLs] forKey:kVLCRecentURLs];
[defaults setBool:self.privateToggleSwitch.on forKey:kVLCPrivateWebStreaming];
[defaults setBool:self.ScanSubToggleSwitch.on forKey:kVLChttpScanSubtitle];
[defaults synchronize];
[super viewWillDisappear:animated];
......@@ -182,7 +187,8 @@
NSString *URLofSubtitle = nil;
if ([URLscheme.scheme isEqualToString:@"http"])
URLofSubtitle = [self _checkURLofSubtitle:url];
if (self.ScanSubToggleSwitch.on)
URLofSubtitle = [self _checkURLofSubtitle:url];
[(VLCAppDelegate*)[UIApplication sharedApplication].delegate openMovieWithExternalSubtitleFromURL:[NSURL URLWithString:url] externalSubURL:URLofSubtitle];
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment