Commit 9b005e74 authored by Felix Paul Kühne's avatar Felix Paul Kühne

UPnP: support downloading all the files we can play (close #11123)

parent 8ca0fad7
......@@ -48,6 +48,7 @@
<string>com.microsoft.waveform-​audio</string>
<string>com.microsoft.windows-​media-wma</string>
<string>com.real.realaudio</string>
<string>org.videolan.vlc</string>
</array>
</dict>
<dict>
......@@ -86,8 +87,6 @@
<string>org.videolan.vlc-ios</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>LSApplicationCategoryType</key>
<string></string>
<key>CFBundleName</key>
<string>VLC for iOS</string>
<key>CFBundlePackageType</key>
......@@ -598,6 +597,18 @@
<key>public.filename-extension</key>
<string>smi</string>
</dict>
<dict>
<key>UTTypeConformsTo</key>
<array>
<string>public.movie</string>
</array>
<key>UTTypeDescription</key>
<string>vlc fake file</string>
<key>UTTypeIdentifier</key>
<string>org.videolan.vlc</string>
<key>public.filename-extension</key>
<string>vlc</string>
</dict>
</array>
</dict>
</plist>
......@@ -75,7 +75,7 @@
#define kVLCPLEXLogin @"plex-login"
#define kVLCPLEXPassword @"plex-password"
#define kSupportedFileExtensions @"\\.(3gp|3gp|3gp2|3gpp|amv|asf|avi|axv|divx|dv|flv|f4v|gvi|gxf|m1v|m2p|m2t|m2ts|m2v|m4v|mks|mkv|moov|mov|mp2v|mp4|mpeg|mpeg1|mpeg2|mpeg4|mpg|mpv|mt2s|mts|mxf|mxg|nsv|nuv|oga|ogg|ogm|ogv|ogx|spx|ps|qt|rec|rm|rmvb|tod|ts|tts|vob|vro|webm|wm|wmv|wtv|xesc)$"
#define kSupportedFileExtensions @"\\.(3gp|3gp|3gp2|3gpp|amv|asf|avi|axv|divx|dv|flv|f4v|gvi|gxf|m1v|m2p|m2t|m2ts|m2v|m4v|mks|mkv|moov|mov|mp2v|mp4|mpeg|mpeg1|mpeg2|mpeg4|mpg|mpv|mt2s|mts|mxf|mxg|nsv|nuv|oga|ogg|ogm|ogv|ogx|spx|ps|qt|rec|rm|rmvb|tod|ts|tts|vlc|vob|vro|webm|wm|wmv|wtv|xesc)$"
#define kSupportedSubtitleFileExtensions @"\\.(srt|sub|cdg|idx|utf|ass|ssa|aqt|jss|psb|rt|smi|txt|smil)$"
#define kSupportedAudioFileExtensions @"\\.(aac|aiff|aif|amr|aob|ape|axa|caf|flac|it|m2a|m4a|m4b|mka|mlp|mod|mp1|mp2|mp3|mpa|mpc|mpga|oga|ogg|oma|opus|rmi|s3m|spx|tta|voc|vqf|wav|w64|wma|wv|xa|xm)$"
......
......@@ -617,12 +617,16 @@
if (uriCollectionObjects.count > 0)
itemURL = [NSURL URLWithString:uriCollectionObjects[correctIndex]];
if (![itemURL.absoluteString isSupportedFormat]) {
UIAlertView * alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"FILE_NOT_SUPPORTED", nil) message:[NSString stringWithFormat:NSLocalizedString(@"FILE_NOT_SUPPORTED_LONG", nil), [mediaItem uri]] delegate:self cancelButtonTitle:NSLocalizedString(@"BUTTON_CANCEL", nil) otherButtonTitles:nil];
[alert show];
} else if (itemURL) {
NSString *fileName = [[mediaItem.title stringByAppendingString:@"."] stringByAppendingString:[[itemURL absoluteString] pathExtension]];
[[(VLCAppDelegate*)[UIApplication sharedApplication].delegate downloadViewController] addURLToDownloadList:itemURL fileNameOfMedia:fileName];
if (itemURL) {
NSString *filename;
/* there are few crappy UPnP servers who don't reveal the correct file extension, so we use a generic fake (#11123) */
if (![itemURL.absoluteString isSupportedFormat])
filename = [mediaItem.title stringByAppendingString:@".vlc"];
else
filename = [[mediaItem.title stringByAppendingString:@"."] stringByAppendingString:[[itemURL absoluteString] pathExtension]];
[[(VLCAppDelegate*)[UIApplication sharedApplication].delegate downloadViewController] addURLToDownloadList:itemURL fileNameOfMedia:filename];
}
}
......
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