ソースを参照

playback: add option to always play video in fullscreen, on by default (closes #14985)

(cherry picked from commit 7f9e30e066f2e9c7b50a6742b418553fc585c3d7)
Felix Paul Kühne 10 年 前
コミット
5b5c573d02

+ 10 - 0
Resources/Settings.bundle/Root.inApp.plist

@@ -83,6 +83,16 @@
 			</array>
 		</dict>
 		<dict>
+			<key>DefaultValue</key>
+			<true/>
+			<key>Key</key>
+			<string>AlwaysUseFullscreenForVideo</string>
+			<key>Title</key>
+			<string>SETTINGS_VIDEO_FULLSCREEN</string>
+			<key>Type</key>
+			<string>PSToggleSwitchSpecifier</string>
+		</dict>
+		<dict>
 			<key>Type</key>
 			<string>PSGroupSpecifier</string>
 			<key>Title</key>

+ 10 - 0
Resources/Settings.bundle/Root.plist

@@ -73,6 +73,16 @@
 			</array>
 		</dict>
 		<dict>
+			<key>DefaultValue</key>
+			<true/>
+			<key>Key</key>
+			<string>AlwaysUseFullscreenForVideo</string>
+			<key>Title</key>
+			<string>SETTINGS_VIDEO_FULLSCREEN</string>
+			<key>Type</key>
+			<string>PSToggleSwitchSpecifier</string>
+		</dict>
+		<dict>
 			<key>Type</key>
 			<string>PSGroupSpecifier</string>
 			<key>Title</key>

+ 1 - 1
Resources/VLCMovieViewController~ipad.xib

@@ -590,7 +590,7 @@
         <image name="audioTrackIcon.png" width="19" height="19"/>
         <image name="backIcon.png" width="32" height="16"/>
         <image name="forwardIcon.png" width="32" height="16"/>
-        <image name="minimizePlayback" width="18" height="10"/>
+        <image name="minimizePlayback" width="15" height="5"/>
         <image name="playIcon.png" width="19" height="17"/>
         <image name="ratioIcon.png" width="15" height="15"/>
         <image name="resetIcon.png" width="24" height="30"/>

+ 1 - 1
Resources/VLCMovieViewController~iphone.xib

@@ -742,7 +742,7 @@
         <image name="audioTrackIcon.png" width="19" height="19"/>
         <image name="backIcon.png" width="32" height="16"/>
         <image name="forwardIcon.png" width="32" height="16"/>
-        <image name="minimizePlayback" width="18" height="10"/>
+        <image name="minimizePlayback" width="15" height="5"/>
         <image name="playIcon.png" width="19" height="17"/>
         <image name="ratioIcon.png" width="15" height="15"/>
         <image name="resetIcon.png" width="24" height="30"/>

+ 4 - 1
Sources/VLCAppDelegate.m

@@ -73,7 +73,8 @@ NSString *const VLCDropboxSessionWasAuthorized = @"VLCDropboxSessionWasAuthorize
                                   kVLCSettingSubtitlesBoldFont: kVLCSettingSubtitlesBoldFontDefaultValue,
                                   kVLCSettingDeinterlace : kVLCSettingDeinterlaceDefaultValue,
                                   kVLCSettingNetworkCaching : kVLCSettingNetworkCachingDefaultValue,
-                                  kVLCSettingPlaybackGestures : [NSNumber numberWithBool:YES],
+                                  kVLCSettingPlaybackGestures : @(YES),
+                                  kVLCSettingVideoFullscreenPlayback : @(YES),
                                   kVLCSettingFTPTextEncoding : kVLCSettingFTPTextEncodingDefaultValue,
                                   kVLCSettingWiFiSharingIPv6 : kVLCSettingWiFiSharingIPv6DefaultValue,
                                   kVLCSettingEqualizerProfile : kVLCSettingEqualizerProfileDefaultValue,
@@ -273,6 +274,7 @@ didFailToContinueUserActivityWithType:(NSString *)userActivityType
             }
             if ([action isEqualToString:@"stream"] && movieURL) {
                 VLCPlaybackController *vpc = [VLCPlaybackController sharedInstance];
+                vpc.fullscreenSessionRequested = YES;
                 [vpc playURL:movieURL successCallback:successCallback errorCallback:errorCallback];
             }
             else if ([action isEqualToString:@"download"] && movieURL) {
@@ -315,6 +317,7 @@ didFailToContinueUserActivityWithType:(NSString *)userActivityType
                 [alert show];
             } else {
                 VLCPlaybackController *vpc = [VLCPlaybackController sharedInstance];
+                vpc.fullscreenSessionRequested = YES;
                 [vpc playURL:url successCallback:nil errorCallback:nil];
             }
         }

+ 1 - 0
Sources/VLCConstants.h

@@ -44,6 +44,7 @@
 #define kVLCSettingsDecrapifyTitles @"MLDecrapifyTitles"
 #define kVLCSettingPlaybackGestures @"EnableGesturesToControlPlayback"
 #define kVLCSettingVariableJumpDuration @"EnableVariableJumpDuration"
+#define kVLCSettingVideoFullscreenPlayback @"AlwaysUseFullscreenForVideo"
 #define kVLCSettingFTPTextEncoding @"ftp-text-encoding"
 #define kVLCSettingFTPTextEncodingDefaultValue @(5) // ISO Latin 1
 #define kVLCSettingPlaybackSpeedDefaultValue @"playback-speed"

+ 2 - 0
Sources/VLCPlaybackController+MediaLibrary.m

@@ -18,11 +18,13 @@
 
 - (void)playMediaLibraryObject:(NSManagedObject *)mediaObject
 {
+    self.fullscreenSessionRequested = YES;
     if ([mediaObject isKindOfClass:[MLFile class]]) {
         [self configureWithFile:(MLFile *)mediaObject];
     }
     else if ([mediaObject isKindOfClass:[MLAlbumTrack class]]) {
         [self configureWithAlbumTrack:(MLAlbumTrack *)mediaObject];
+        self.fullscreenSessionRequested = NO;
     }
     else if ([mediaObject isKindOfClass:[MLShowEpisode class]])
         [self configureWithShowEpisode:(MLShowEpisode *)mediaObject];

+ 1 - 0
Sources/VLCPlaybackController.h

@@ -74,6 +74,7 @@ currentMediaHasTrackToChooseFrom:(BOOL)currentMediaHasTrackToChooseFrom
 @property (nonatomic, readonly) BOOL currentMediaHasTrackToChooseFrom;
 @property (nonatomic, readonly) BOOL activePlaybackSession;
 @property (nonatomic, readonly) BOOL audioOnlyPlaybackSession;
+@property (nonatomic, readwrite) BOOL fullscreenSessionRequested;
 
 + (VLCPlaybackController *)sharedInstance;
 

+ 9 - 0
Sources/VLCPlayerDisplayController.m

@@ -118,6 +118,15 @@ static inline void commonSetup(VLCPlayerDisplayController *self)
 
 - (void)playbackDidStart:(NSNotification *)notification
 {
+    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
+    BOOL enforceFullscreen = [[defaults objectForKey:kVLCSettingVideoFullscreenPlayback] boolValue];
+
+    VLCPlaybackController *vpc = [VLCPlaybackController sharedInstance];
+    if (vpc.fullscreenSessionRequested && enforceFullscreen) {
+        [self showFullscreenPlayback];
+        return;
+    }
+
     switch (self.displayMode) {
         case VLCPlayerDisplayControllerDisplayModeFullscreen:
             [self _presentFullscreenPlaybackViewIfNeeded];