Commit 1c08e734 authored by Robert Gordon's avatar Robert Gordon Committed by Carola Nitz

VideoOptionsControlBar: Implement new ui components and pseudo-functionality for repeat button

Made OptionsControlBar respond to device orientation

Fix not working button actions.

Fixed buttons not triggering respective functions when tapped.
parent 200cd50c
......@@ -370,3 +370,11 @@
"UNKNOWN_ARTIST" = "Unknown Artist";
"VARIOUS_ARTIST" = "Various Artists";
"UNKNOWN_ALBUM" = "Unknown Album";
/* New strings */
"INTERFACE_LOCK_BUTTON" = "Lock interface";
"INTERFACE_LOCK_HINT" = "Disable interface controls";
"MORE_OPTIONS_BUTTON" = "More";
"MORE_OPTIONS_HINT" = "View more option controls";
"REPEAT_MODE_HINT" = "Change repeat mode of current item";
"VIDEO_ASPECT_RATIO_HINT" = "Change the aspect ratio of the current video";
......@@ -44,6 +44,7 @@
#define DEFAULT_FOV 80.f
#define MAX_FOV 150.f
#define MIN_FOV 20.f
#define NEW_UI 0
typedef NS_ENUM(NSInteger, VLCPanType) {
VLCPanTypeNone,
......@@ -53,7 +54,7 @@ typedef NS_ENUM(NSInteger, VLCPanType) {
VLCPanTypeProjection
};
@interface VLCMovieViewController () <UIGestureRecognizerDelegate, VLCMultiSelectionViewDelegate, VLCEqualizerViewUIDelegate, VLCPlaybackControllerDelegate, VLCDeviceMotionDelegate, VLCRendererDiscovererManagerDelegate, PlaybackSpeedViewDelegate>
@interface VLCMovieViewController () <UIGestureRecognizerDelegate, VLCMultiSelectionViewDelegate, VLCEqualizerViewUIDelegate, VLCPlaybackControllerDelegate, VLCDeviceMotionDelegate, VLCRendererDiscovererManagerDelegate, PlaybackSpeedViewDelegate, VLCVideoOptionsControlBarDelegate>
{
BOOL _controlsHidden;
BOOL _videoFiltersHidden;
......@@ -96,6 +97,7 @@ typedef NS_ENUM(NSInteger, VLCPanType) {
VLCEqualizerView *_equalizerView;
VLCMultiSelectionMenuView *_multiSelectionView;
VLCVideoOptionsControlBar *_videoOptionsControlBar;
VLCPlaybackController *_vpc;
......@@ -163,14 +165,13 @@ typedef NS_ENUM(NSInteger, VLCPanType) {
_saturationSlider.accessibilityLabel = _saturationLabel.text;
_gammaLabel.text = NSLocalizedString(@"VFILTER_GAMMA", nil);
_gammaSlider.accessibilityLabel = _gammaLabel.text;
_resetVideoFilterButton.accessibilityLabel = NSLocalizedString(@"VIDEO_FILTER_RESET_BUTTON", nil);
_multiSelectionView = [[VLCMultiSelectionMenuView alloc] init];
_multiSelectionView.delegate = self;
_multiSelectionView.autoresizingMask = UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleTopMargin;
_multiSelectionView.hidden = YES;
[self.view addSubview:_multiSelectionView];
#if !NEW_UI
[self setupMultiSelectionView];
#else
[self setupVideoOptionsControlBar];
#endif
_scrubHelpLabel.text = NSLocalizedString(@"PLAYBACK_SCRUB_HELP", nil);
......@@ -241,6 +242,26 @@ typedef NS_ENUM(NSInteger, VLCPanType) {
[self setupRendererDiscovererManager];
}
- (void) setupMultiSelectionView
{
_multiSelectionView = [[VLCMultiSelectionMenuView alloc] init];
_multiSelectionView.delegate = self;
_multiSelectionView.autoresizingMask = UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleTopMargin;
_multiSelectionView.hidden = YES;
_multiSelectionView.repeatMode = _vpc.repeatMode;
[self.view addSubview:_multiSelectionView];
}
- (void)setupVideoOptionsControlBar
{
_videoOptionsControlBar = [[VLCVideoOptionsControlBar alloc] init];
_videoOptionsControlBar.delegate = self;
_videoOptionsControlBar.hidden = YES;
_videoOptionsControlBar.repeatMode = _vpc.repeatMode;
_videoOptionsControlBar.spacing = 32.0f;
[self.view addSubview:_videoOptionsControlBar];
}
- (void)setupGestureRecognizers
{
_tapOnVideoRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(toggleControlsVisible)];
......@@ -347,8 +368,10 @@ typedef NS_ENUM(NSInteger, VLCPanType) {
[NSLayoutConstraint constraintWithItem:_trackSelectorContainer attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationLessThanOrEqual toItem:self.view attribute:NSLayoutAttributeHeight multiplier:2.0/3.0 constant:0],
[_videoFilterView.bottomAnchor constraintEqualToAnchor:_controllerPanel.topAnchor]
];
[NSLayoutConstraint activateConstraints:constraints];
#if NEW_UI
constraints = [constraints arrayByAddingObjectsFromArray:[self getVideoOptionsConstraints]];
#endif
[NSLayoutConstraint activateConstraints: constraints];
}
- (UIButton *)doneButton
......@@ -450,6 +473,26 @@ typedef NS_ENUM(NSInteger, VLCPanType) {
}
}
- (void)layoutFrameForMultiSelectionView
{
CGRect controllerPanelFrame = _controllerPanel.frame;
CGRect multiSelectionFrame;
BOOL isIphone = (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone);
if (!isIphone) {
_multiSelectionView.showsEqualizer = YES;
return;
}
BOOL isLandscape = UIInterfaceOrientationIsLandscape([[UIApplication sharedApplication] statusBarOrientation]);
_multiSelectionView.showsEqualizer = isLandscape;
multiSelectionFrame = (CGRect){CGPointMake(0., 0.), [_multiSelectionView proposedDisplaySize]};
multiSelectionFrame.origin.x = controllerPanelFrame.size.width - multiSelectionFrame.size.width;
multiSelectionFrame.origin.y = controllerPanelFrame.origin.y - multiSelectionFrame.size.height;
_multiSelectionView.frame = multiSelectionFrame;
}
- (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
......@@ -459,8 +502,13 @@ typedef NS_ENUM(NSInteger, VLCPanType) {
[_vpc recoverDisplayedMetadata];
[self resetVideoFiltersSliders];
_vpc.videoOutputView = self.movieView;
_multiSelectionView.repeatMode = _vpc.repeatMode;
_multiSelectionView.shuffleMode = _vpc.isShuffleMode;
#if !NEW_UI
_multiSelectionView.repeatMode = _vpc.repeatMode;
_multiSelectionView.shuffleMode = _vpc.isShuffleMode;
#else
_videoOptionsControlBar.repeatMode = _vpc.repeatMode;
#endif
//Media is loaded in the media player, checking the projection type and configuring accordingly.
[self setupForMediaProjection];
......@@ -472,31 +520,10 @@ typedef NS_ENUM(NSInteger, VLCPanType) {
equalizerRect.origin.x = CGRectGetMidX(self.view.bounds) - CGRectGetWidth(equalizerRect)/2.0;
equalizerRect.origin.y = CGRectGetMidY(self.view.bounds) - CGRectGetHeight(equalizerRect)/2.0;
_equalizerView.frame = equalizerRect;
CGRect multiSelectionFrame;
CGRect controllerPanelFrame = _controllerPanel.frame;;
if (UI_USER_INTERFACE_IDIOM() != UIUserInterfaceIdiomPhone) {
multiSelectionFrame = (CGRect){CGPointMake(0., 0.), [_multiSelectionView proposedDisplaySize]};
multiSelectionFrame.origin.x = controllerPanelFrame.size.width - multiSelectionFrame.size.width;
multiSelectionFrame.origin.y = controllerPanelFrame.origin.y - multiSelectionFrame.size.height;
_multiSelectionView.frame = multiSelectionFrame;
_multiSelectionView.showsEqualizer = YES;
return;
}
if (UIInterfaceOrientationIsLandscape([[UIApplication sharedApplication] statusBarOrientation])) {
_multiSelectionView.showsEqualizer = YES;
multiSelectionFrame = (CGRect){CGPointMake(0., 0.), [_multiSelectionView proposedDisplaySize]};
multiSelectionFrame.origin.x = controllerPanelFrame.size.width - multiSelectionFrame.size.width;
multiSelectionFrame.origin.y = controllerPanelFrame.origin.y - multiSelectionFrame.size.height;
} else {
_multiSelectionView.showsEqualizer = NO;
multiSelectionFrame = (CGRect){CGPointMake(0., 0.), [_multiSelectionView proposedDisplaySize]};
multiSelectionFrame.origin.x = controllerPanelFrame.size.width - multiSelectionFrame.size.width;
multiSelectionFrame.origin.y = controllerPanelFrame.origin.y - multiSelectionFrame.size.height;
}
_multiSelectionView.frame = multiSelectionFrame;
#if !NEW_UI
[self layoutFrameForMultiSelectionView];
#endif
self.scrubViewTopConstraint.constant = CGRectGetMaxY(self.navigationController.navigationBar.frame);
}
......@@ -648,26 +675,39 @@ typedef NS_ENUM(NSInteger, VLCPanType) {
- (NSArray *)itemsForInterfaceLock
{
return @[_pinchRecognizer,
_panRecognizer,
_tapRecognizer,
_doneButton,
_doubleTapRecognizer,
_timeNavigationTitleView.minimizePlaybackButton,
_timeNavigationTitleView.positionSlider,
_timeNavigationTitleView.aspectRatioButton,
_controllerPanel.playbackSpeedButton,
_controllerPanel.trackSwitcherButton,
_controllerPanel.bwdButton,
_controllerPanel.playPauseButton,
_controllerPanel.fwdButton,
_controllerPanel.videoFilterButton,
_multiSelectionView.equalizerButton,
_multiSelectionView.chapterSelectorButton,
_multiSelectionView.repeatButton,
_multiSelectionView.shuffleButton,
_controllerPanel.volumeView,
_rendererButton];
NSArray *arr = [NSArray arrayWithObjects:
_pinchRecognizer,
_panRecognizer,
_tapRecognizer,
_doneButton,
_doubleTapRecognizer,
_timeNavigationTitleView.minimizePlaybackButton,
_timeNavigationTitleView.positionSlider,
_timeNavigationTitleView.aspectRatioButton,
_controllerPanel.playbackSpeedButton,
_controllerPanel.trackSwitcherButton,
_controllerPanel.bwdButton,
_controllerPanel.playPauseButton,
_controllerPanel.fwdButton,
_controllerPanel.videoFilterButton,
_controllerPanel.volumeView,
_rendererButton,
nil];
#if !NEW_UI
return [arr arrayByAddingObjectsFromArray:
@[_multiSelectionView.equalizerButton,
_multiSelectionView.chapterSelectorButton,
_multiSelectionView.repeatButton,
_multiSelectionView.shuffleButton,
_controllerPanel.volumeView,
_rendererButton]];
#else
return [arr arrayByAddingObjectsFromArray:
@[_videoOptionsControlBar.toggleFullScreenButton,
_videoOptionsControlBar.selectSubtitleButton,
_videoOptionsControlBar.moreOptionsButton,
_videoOptionsControlBar.repeatButton]];
#endif
}
- (void)handlePinchGesture:(UIPinchGestureRecognizer *)recognizer
......@@ -724,8 +764,14 @@ typedef NS_ENUM(NSInteger, VLCPanType) {
_sleepTimerContainer.alpha = 0.0f;
_sleepTimerContainer.hidden = YES;
}
#if !NEW_UI
_multiSelectionView.alpha = 0.0f;
_multiSelectionView.hidden = YES;
#else
_videoOptionsControlBar.alpha = 0.0f;
_videoOptionsControlBar.hidden = YES;
#endif
_artistNameLabel.hidden = NO;
_albumNameLabel.hidden = NO;
......@@ -738,8 +784,14 @@ typedef NS_ENUM(NSInteger, VLCPanType) {
self->_videoFilterView.alpha = alpha;
self->_playbackSpeedView.alpha = alpha;
self->_trackSelectorContainer.alpha = alpha;
#if !NEW_UI
self->_multiSelectionView.alpha = alpha;
#else
self->_videoOptionsControlBar.alpha = alpha;
#endif
self->_equalizerView.alpha = alpha;
self->_multiSelectionView.alpha = alpha;
if (self->_sleepTimerContainer)
self->_sleepTimerContainer.alpha = alpha;
......@@ -758,7 +810,13 @@ typedef NS_ENUM(NSInteger, VLCPanType) {
self->_equalizerView.hidden = YES;
if (self->_sleepTimerContainer)
self->_sleepTimerContainer.hidden = YES;
self->_multiSelectionView.hidden = YES;
#if !NEW_UI
self->_multiSelectionView.hidden = YES;
#else
self->_videoOptionsControlBar.hidden = YES;
#endif
self->_artistNameLabel.hidden = self->_audioOnly ? NO : self->_controlsHidden;
self->_albumNameLabel.hidden = self->_audioOnly ? NO : self->_controlsHidden;
......@@ -1118,8 +1176,10 @@ currentMediaHasTrackToChooseFrom:(BOOL)currentMediaHasTrackToChooseFrom
[self.statusLabel showStatusMessage:NSLocalizedString(@"PLAYBACK_FAILED", nil)];
[_controllerPanel updateButtons];
_multiSelectionView.mediaHasChapters = currentMediaHasChapters;
#if !NEW_UI
_multiSelectionView.mediaHasChapters = currentMediaHasChapters;
#endif
}
- (void)savePlaybackState:(VLCPlaybackController *)controller
......@@ -1257,32 +1317,26 @@ currentMediaHasTrackToChooseFrom:(BOOL)currentMediaHasTrackToChooseFrom
[self setControlsHidden:YES animated:YES];
}
- (void)moreActions:(UIButton *)sender
{
- (void)toggleMultiSelectionView:(UIButton *)sender {
if (_multiSelectionView.hidden == NO) {
[UIView animateWithDuration:.3
animations:^{
self->_multiSelectionView.hidden = YES;
}
completion:^(BOOL finished){
}];
completion:nil];
return;
}
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) {
if (UIInterfaceOrientationIsLandscape([[UIApplication sharedApplication] statusBarOrientation])) {
_multiSelectionView.showsEqualizer = YES;
} else {
_multiSelectionView.showsEqualizer = NO;
}
}
BOOL isLandscape = UIInterfaceOrientationIsLandscape([[UIApplication sharedApplication] statusBarOrientation]);
BOOL isIphone = (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone);
_multiSelectionView.showsEqualizer = (isLandscape && isIphone) || !isIphone;
CGRect workFrame = _multiSelectionView.frame;
workFrame.size = [_multiSelectionView proposedDisplaySize];
workFrame.origin.x = CGRectGetMaxX(sender.frame) - workFrame.size.width;
_multiSelectionView.alpha = 1.0f;
/* animate */
_multiSelectionView.frame = CGRectMake(workFrame.origin.x, workFrame.origin.y + workFrame.size.height, workFrame.size.width, 0.);
[UIView animateWithDuration:.3
......@@ -1290,8 +1344,29 @@ currentMediaHasTrackToChooseFrom:(BOOL)currentMediaHasTrackToChooseFrom
self->_multiSelectionView.frame = workFrame;
self->_multiSelectionView.hidden = NO;
}
completion:^(BOOL finished){
}];
completion:nil];
}
- (void) toggleVideoOptionsBar
{
CGFloat alpha = _videoOptionsControlBar.hidden ? 1.0f : 0.0f;
BOOL hidden = !_videoOptionsControlBar.hidden;
[UIView animateWithDuration:.3
animations:^{
self->_videoOptionsControlBar.alpha = alpha;
self->_videoOptionsControlBar.hidden = hidden;
}
completion:nil];
}
- (void)moreActions:(UIButton *)sender
{
#if !NEW_UI
[self toggleMultiSelectionView:sender];
#else
[self toggleVideoOptionsBar];
#endif
[self _resetIdleTimer];
}
......@@ -1322,7 +1397,10 @@ currentMediaHasTrackToChooseFrom:(BOOL)currentMediaHasTrackToChooseFrom
NSAssert(NO, @"class not handled");
}
}
_multiSelectionView.displayLock = _interfaceIsLocked;
#if !NEW_UI
_multiSelectionView.displayLock = _interfaceIsLocked;
#endif
}
- (void)toggleEqualizer
......@@ -1379,20 +1457,30 @@ currentMediaHasTrackToChooseFrom:(BOOL)currentMediaHasTrackToChooseFrom
- (void)toggleRepeatMode
{
[[VLCPlaybackController sharedInstance] toggleRepeatMode];
_multiSelectionView.repeatMode = [VLCPlaybackController sharedInstance].repeatMode;
#if !NEW_UI
_multiSelectionView.repeatMode = [VLCPlaybackController sharedInstance].repeatMode;
#else
_videoOptionsControlBar.repeatMode = [VLCPlaybackController sharedInstance].repeatMode;
#endif
}
- (void)toggleShuffleMode
{
_vpc.shuffleMode = !_vpc.isShuffleMode;
_multiSelectionView.shuffleMode = _vpc.isShuffleMode;
#if !NEW_UI
_multiSelectionView.shuffleMode = _vpc.isShuffleMode;
#endif
}
- (void)hideMenu
{
[UIView animateWithDuration:.2
animations:^{
#if !NEW_UI
self->_multiSelectionView.hidden = YES;
#else
self->_videoOptionsControlBar.hidden = YES;
#endif
}
completion:^(BOOL finished){
}];
......@@ -1691,12 +1779,10 @@ currentMediaHasTrackToChooseFrom:(BOOL)currentMediaHasTrackToChooseFrom
- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator
{
[super viewWillTransitionToSize:size withTransitionCoordinator:coordinator];
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) {
[coordinator animateAlongsideTransition:^(id<UIViewControllerTransitionCoordinatorContext> _Nonnull context) {
if (self.artworkImageView.image)
self.trackNameLabel.hidden = YES;
if (self.artworkImageView.image)
self.trackNameLabel.hidden = YES;
if (!self->_equalizerView.hidden)
self->_equalizerView.hidden = YES;
......@@ -1710,6 +1796,14 @@ currentMediaHasTrackToChooseFrom:(BOOL)currentMediaHasTrackToChooseFrom
[self setControlsHidden:NO animated:YES];
}
- (NSArray *)getVideoOptionsConstraints
{
return @[
[_videoOptionsControlBar.centerXAnchor constraintEqualToAnchor:self.view.centerXAnchor],
[_videoOptionsControlBar.bottomAnchor constraintEqualToAnchor:_controllerPanel.topAnchor constant:-50],
];
}
#pragma mark - External Display
- (void)showOnDisplay:(UIView *)view
......@@ -1775,4 +1869,26 @@ currentMediaHasTrackToChooseFrom:(BOOL)currentMediaHasTrackToChooseFrom
[self showSleepTimer];
}
#pragma mark - VLCVideoOptionsControlBarDelegate
- (void)didSelectMoreOptions:(VLCVideoOptionsControlBar * _Nonnull)optionsBar {
[self moreActions:optionsBar.moreOptionsButton];
}
- (void)didSelectSubtitle:(VLCVideoOptionsControlBar * _Nonnull)optionsBar {
NSLog(@"subtitles Selected");
}
- (void)didToggleFullScreen:(VLCVideoOptionsControlBar * _Nonnull)optionsBar {
[_vpc toggleFullScreen];
}
- (void)didToggleInterfaceLock:(VLCVideoOptionsControlBar * _Nonnull)optionsBar {
[self toggleUILock];
}
- (void)didToggleRepeat:(VLCVideoOptionsControlBar * _Nonnull)optionsBar {
[self toggleRepeatMode];
}
@end
......@@ -9,13 +9,13 @@
* Refer to the COPYING file of the official project for license.
*****************************************************************************/
@objc (VideoOptionsControlBarDelegate)
@objc (VLCVideoOptionsControlBarDelegate)
protocol VideoOptionsControlBarDelegate: class {
func didToggleFullScreen(_ optionsBar: VideoOptionsControlBar)
func didToggleRepeat(_ optionsBar: VideoOptionsControlBar)
func didSelectSubtitle(_ optionsBar: VideoOptionsControlBar)
func didSelectMoreOptions(_ optionsBar: VideoOptionsControlBar)
func didToggleOrientationLock(_ optionsBar: VideoOptionsControlBar)
func didToggleInterfaceLock(_ optionsBar: VideoOptionsControlBar)
}
@objc (VLCVideoOptionsControlBar)
......@@ -24,63 +24,86 @@ protocol VideoOptionsControlBarDelegate: class {
// MARK: Instance variables
weak var delegate: VideoOptionsControlBarDelegate?
var repeatMode: VLCRepeatMode {
didSet {
switch repeatMode {
case .repeatCurrentItem:
repeatButton.setImage(UIImage(named: "repeatOne-new"), for: .normal)
case .repeatAllItems:
repeatButton.setImage(UIImage(named: "repeat-new"), for: .normal)
case .doNotRepeat:
repeatButton.setImage(UIImage(named: "no-repeat-new"), for: .normal)
default:
assertionFailure("unhandled repeatmode")
}
}
}
lazy var toggleFullScreenButton: UIButton = {
var toggle = UIButton(type: .system)
toggle.addTarget(self, action: #selector(toggleFullscreen), for: .touchUpInside)
toggle.setImage(UIImage(named: "fullscreenIcon-new"), for: .normal)
toggle.tintColor = .orange
//TODO: add accessability options for fullScreenButton
toggle.addTarget(self, action: #selector(toggleFullscreen), for: .touchUpInside)
toggle.tintColor = .white
toggle.accessibilityLabel = NSLocalizedString("VIDEO_ASPECT_RATIO_BUTTON", comment: "")
toggle.accessibilityHint = NSLocalizedString("VIDEO_ASPECT_RATIO_HINT", comment: "")
return toggle
}()
lazy var selectSubtitleButton: UIButton = {
var subbutton = UIButton(type: .system)
subbutton.setImage(UIImage(named: "subtitlesIcon-new"), for: .normal)
subbutton.addTarget(self, action: #selector(selectSubtitle), for: .touchUpInside)
subbutton.setImage(UIImage(named: "subtitleIcon-new"), for: .normal)
subbutton.tintColor = .orange
//TODO: add accessability options for selectingSubtitleButton
subbutton.tintColor = .white
subbutton.accessibilityHint = NSLocalizedString("CHOOSE_SUBTITLE_TRACK", comment: "")
subbutton.accessibilityLabel = NSLocalizedString("SUBTITLES", comment: "")
return subbutton
}()
lazy var repeatButton: UIButton = {
var rptButton = UIButton(type: .system)
rptButton.addTarget(self, action: #selector(toggleRepeat), for: .touchUpInside)
rptButton.setImage(UIImage(named: "repeatOne-new"), for: .normal)
rptButton.tintColor = .orange
//TODO: add accessability options for repeatButton
rptButton.setImage(UIImage(named: "no-repeat-new"), for: .normal)
rptButton.tintColor = .white
rptButton.accessibilityHint = NSLocalizedString("REPEAT_MODE", comment: "")
rptButton.accessibilityLabel = NSLocalizedString("REPEAT_MODE_HINT", comment: "")
return rptButton
}()
lazy var orientationLockButton: UIButton = {
var orientLockButton = UIButton(type: .system)
orientLockButton.addTarget(self, action: #selector(toggleOrientation), for: .touchUpInside)
orientLockButton.setImage(UIImage(named: "lockIcon-new"), for: .normal)
orientLockButton.tintColor = .orange
//TODO: add accessability options for orientationLockButton
return orientLockButton
lazy var interfaceLockButton: UIButton = {
var interfaceLockButton = UIButton(type: .system)
interfaceLockButton.setImage(UIImage(named: "lock-new"), for: .normal)
interfaceLockButton.addTarget(self, action: #selector(toggleInterfaceLock), for: .touchUpInside)
interfaceLockButton.tintColor = .white
interfaceLockButton.accessibilityHint = NSLocalizedString("INTERFACE_LOCK_HINT", comment: "")
interfaceLockButton.accessibilityLabel = NSLocalizedString("INTERFACE_LOCK_BUTTON", comment: "")
return interfaceLockButton
}()
lazy var moreOptionsButton: UIButton = {
var moreOptionsButton = UIButton(type: .system)
moreOptionsButton.addTarget(self, action: #selector(selectMoreOptions), for: .touchUpInside)
moreOptionsButton.setImage(UIImage(named: "moreWhite-new"), for: .normal)
moreOptionsButton.tintColor = .orange
//TODO: add accessability options for moreOptionsButton
moreOptionsButton.addTarget(self, action: #selector(selectMoreOptions), for: .touchUpInside)
moreOptionsButton.tintColor = .white
moreOptionsButton.accessibilityHint = NSLocalizedString("MORE_OPTIONS_HINT", comment: "")
moreOptionsButton.accessibilityLabel = NSLocalizedString("MORE_OPTIONS_BUTTON", comment: "")
return moreOptionsButton
}()
// MARK: Class Initializers
required init(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
fatalError("init(coder aDecoder: NSCoder) not implemented")
}
override init(frame: CGRect) {
repeatMode = .doNotRepeat
super.init(frame: frame)
addArrangedSubview(toggleFullScreenButton)
addArrangedSubview(selectSubtitleButton)
addArrangedSubview(repeatButton)
addArrangedSubview(orientationLockButton)
addArrangedSubview(interfaceLockButton)
addArrangedSubview(moreOptionsButton)
axis = .horizontal
translatesAutoresizingMaskIntoConstraints = false
}
// MARK: Button Action Buttons
......@@ -100,8 +123,8 @@ protocol VideoOptionsControlBarDelegate: class {
delegate?.didToggleRepeat(self)
}
func toggleOrientation() {
delegate?.didToggleOrientationLock(self)
func toggleInterfaceLock() {
delegate?.didToggleInterfaceLock(self)
}
}
......
{
"images" : [
{
"idiom" : "universal",
"filename" : "no-repeat-new.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "no-repeat-new@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "no-repeat-new@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "repeat-new.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "repeat-new@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "repeat-new@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
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