Commit 19c863d2 authored by Felix Paul Kühne's avatar Felix Paul Kühne

iOS playback: add activity indicator from the tvOS interface (refs #216)

parent b8d72040
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.iPad.XIB" version="3.0" toolsVersion="14109" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none" colorMatched="YES"> <document type="com.apple.InterfaceBuilder3.CocoaTouch.iPad.XIB" version="3.0" toolsVersion="14113" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none" colorMatched="YES">
<device id="ipad9_7" orientation="portrait"> <device id="ipad9_7" orientation="portrait">
<adaptation id="fullscreen"/> <adaptation id="fullscreen"/>
</device> </device>
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
<objects> <objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="VLCMovieViewController"> <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="VLCMovieViewController">
<connections> <connections>
<outlet property="activityIndicator" destination="1Bq-rl-k4J" id="DeR-JB-gXq"/>
<outlet property="albumNameLabel" destination="305" id="308"/> <outlet property="albumNameLabel" destination="305" id="308"/>
<outlet property="artistNameLabel" destination="303" id="306"/> <outlet property="artistNameLabel" destination="303" id="306"/>
<outlet property="artworkImageView" destination="g3j-bZ-K3S" id="fPn-6f-Kez"/> <outlet property="artworkImageView" destination="g3j-bZ-K3S" id="fPn-6f-Kez"/>
...@@ -245,6 +246,10 @@ ...@@ -245,6 +246,10 @@
<color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
<activityIndicatorView opaque="NO" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" misplaced="YES" style="whiteLarge" id="1Bq-rl-k4J">
<rect key="frame" x="366" y="542" width="37" height="37"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
</activityIndicatorView>
<view contentMode="scaleToFill" id="141" userLabel="Video Effects Panel" customClass="VLCFrostedGlasView"> <view contentMode="scaleToFill" id="141" userLabel="Video Effects Panel" customClass="VLCFrostedGlasView">
<rect key="frame" x="470" y="782" width="298" height="192"/> <rect key="frame" x="470" y="782" width="298" height="192"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES"/> <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES"/>
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14109" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" colorMatched="YES"> <document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14113" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" colorMatched="YES">
<device id="retina4_7" orientation="portrait"> <device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/> <adaptation id="fullscreen"/>
</device> </device>
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
<objects> <objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="VLCMovieViewController"> <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="VLCMovieViewController">
<connections> <connections>
<outlet property="activityIndicator" destination="vR5-i9-KEJ" id="mxp-ZT-rNk"/>
<outlet property="albumNameLabel" destination="280" id="285"/> <outlet property="albumNameLabel" destination="280" id="285"/>
<outlet property="artistNameLabel" destination="279" id="283"/> <outlet property="artistNameLabel" destination="279" id="283"/>
<outlet property="artworkImageView" destination="yK6-Ph-SVE" id="Cm9-7F-iYZ"/> <outlet property="artworkImageView" destination="yK6-Ph-SVE" id="Cm9-7F-iYZ"/>
...@@ -95,6 +96,10 @@ ...@@ -95,6 +96,10 @@
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
<color key="shadowColor" red="1" green="1" blue="1" alpha="0.59999999999999998" colorSpace="custom" customColorSpace="sRGB"/> <color key="shadowColor" red="1" green="1" blue="1" alpha="0.59999999999999998" colorSpace="custom" customColorSpace="sRGB"/>
</label> </label>
<activityIndicatorView opaque="NO" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" misplaced="YES" style="whiteLarge" id="vR5-i9-KEJ">
<rect key="frame" x="169" y="373" width="37" height="37"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
</activityIndicatorView>
<view hidden="YES" userInteractionEnabled="NO" contentMode="scaleToFill" id="108" userLabel="Playing Externally View" customClass="VLCPlayingExternallyView" customModule="VLC_iOS" customModuleProvider="target"> <view hidden="YES" userInteractionEnabled="NO" contentMode="scaleToFill" id="108" userLabel="Playing Externally View" customClass="VLCPlayingExternallyView" customModule="VLC_iOS" customModuleProvider="target">
<rect key="frame" x="28" y="178" width="320" height="257"/> <rect key="frame" x="28" y="178" width="320" height="257"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
......
...@@ -69,6 +69,8 @@ typedef NS_ENUM(NSInteger, VLCMovieJumpState) { ...@@ -69,6 +69,8 @@ typedef NS_ENUM(NSInteger, VLCMovieJumpState) {
@property (nonatomic, strong) IBOutlet UIImageView *artworkImageView; @property (nonatomic, strong) IBOutlet UIImageView *artworkImageView;
@property (nonatomic, strong) IBOutlet NSLayoutConstraint *widthConstraint; @property (nonatomic, strong) IBOutlet NSLayoutConstraint *widthConstraint;
@property (nonatomic, strong) IBOutlet UIActivityIndicatorView *activityIndicator;
- (IBAction)closePlayback:(id)sender; - (IBAction)closePlayback:(id)sender;
- (IBAction)minimizePlayback:(id)sender; - (IBAction)minimizePlayback:(id)sender;
......
...@@ -432,7 +432,7 @@ typedef NS_ENUM(NSInteger, VLCPanType) { ...@@ -432,7 +432,7 @@ typedef NS_ENUM(NSInteger, VLCPanType) {
manager.presentingViewController = self; manager.presentingViewController = self;
manager.delegate = self; manager.delegate = self;
if (_vpc.renderer || [[UIDevice currentDevice] VLCHasExternalDisplay]) { if (_vpc.renderer || [[UIDevice currentDevice] VLCHasExternalDisplay]) {
[self showOnDisplay:_playingExternalView.displayView]; [self showOnDisplay:_playingExternalView.displayView];
} }
} }
...@@ -778,6 +778,24 @@ typedef NS_ENUM(NSInteger, VLCPanType) { ...@@ -778,6 +778,24 @@ typedef NS_ENUM(NSInteger, VLCPanType) {
[self setControlsHidden:!_controlsHidden animated:YES]; [self setControlsHidden:!_controlsHidden animated:YES];
} }
- (void)updateActivityIndicatorForState:(VLCMediaPlayerState)state {
UIActivityIndicatorView *indicator = self.activityIndicator;
switch (state) {
case VLCMediaPlayerStateBuffering:
if (!indicator.isAnimating) {
self.activityIndicator.alpha = 1.0;
[self.activityIndicator startAnimating];
}
break;
default:
if (indicator.isAnimating) {
[self.activityIndicator stopAnimating];
self.activityIndicator.alpha = 0.0;
}
break;
}
}
- (void)_resetIdleTimer - (void)_resetIdleTimer
{ {
if (!_idleTimer) if (!_idleTimer)
...@@ -1002,6 +1020,9 @@ typedef NS_ENUM(NSInteger, VLCPanType) { ...@@ -1002,6 +1020,9 @@ typedef NS_ENUM(NSInteger, VLCPanType) {
- (void)playbackPositionUpdated:(VLCPlaybackController *)controller - (void)playbackPositionUpdated:(VLCPlaybackController *)controller
{ {
// FIXME: hard coded state since the state in mediaPlayer is incorrectly still buffering
[self updateActivityIndicatorForState:VLCMediaPlayerStatePlaying];
if (!_isScrubbing) { if (!_isScrubbing) {
self.timeNavigationTitleView.positionSlider.value = [controller playbackPosition]; self.timeNavigationTitleView.positionSlider.value = [controller playbackPosition];
} }
...@@ -1043,6 +1064,8 @@ currentMediaHasTrackToChooseFrom:(BOOL)currentMediaHasTrackToChooseFrom ...@@ -1043,6 +1064,8 @@ currentMediaHasTrackToChooseFrom:(BOOL)currentMediaHasTrackToChooseFrom
currentMediaHasChapters:(BOOL)currentMediaHasChapters currentMediaHasChapters:(BOOL)currentMediaHasChapters
forPlaybackController:(VLCPlaybackController *)controller forPlaybackController:(VLCPlaybackController *)controller
{ {
[self updateActivityIndicatorForState:currentState];
if (currentState == VLCMediaPlayerStateBuffering) if (currentState == VLCMediaPlayerStateBuffering)
_mediaDuration = controller.mediaDuration; _mediaDuration = controller.mediaDuration;
......
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