Commit 4a38e44d authored by Carola Nitz's avatar Carola Nitz

360Video: moved currentMediaIs360 to playbackController

adjusted Bool properties from nonatomic to assign
turned interfacelock off for 360Videos

(cherry picked from commit e10b9f28)
parent 9563d3af
......@@ -643,21 +643,23 @@ typedef NS_ENUM(NSInteger, VLCPanType) {
- (void)handlePinchGesture:(UIPinchGestureRecognizer *)recognizer
{
if (!_closeGestureEnabled || isnan(recognizer.velocity))
return;
CGFloat diff = DEFAULT_FOV * -(ZOOM_SENSITIVITY * recognizer.velocity / _screenSizePixel.width);
if ([_vpc currentMediaProjection] == VLCMediaProjectionEquiRectangular) {
if ([_vpc updateViewpoint:0 pitch:0 roll:0 fov:diff absolute:NO]) {
//Checking for fov value in case of
_fov = MAX(MIN(_fov + diff, MAX_FOV), MIN_FOV);
}
} else if (recognizer.velocity < 0.) {
if ([_vpc currentMediaIs360Video]) {
[self zoom360Video:diff];
} else if (recognizer.velocity < 0. && _closeGestureEnabled) {
[self minimizePlayback:nil];
}
}
- (void)zoom360Video:(CGFloat)zoom
{
if ([_vpc updateViewpoint:0 pitch:0 roll:0 fov:zoom absolute:NO]) {
//Checking for fov value in case of
_fov = MAX(MIN(_fov + zoom, MAX_FOV), MIN_FOV);
}
}
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch
{
if (touch.view != self.view)
......@@ -847,7 +849,7 @@ typedef NS_ENUM(NSInteger, VLCPanType) {
- (void)setupForMediaProjection
{
BOOL mediaHasProjection = [_vpc currentMediaProjection] == VLCMediaProjectionEquiRectangular;
BOOL mediaHasProjection = [_vpc currentMediaIs360Video];
_fov = mediaHasProjection ? DEFAULT_FOV : 0.f;
[_panRecognizer setEnabled:mediaHasProjection];
......@@ -1337,14 +1339,14 @@ currentMediaHasTrackToChooseFrom:(BOOL)currentMediaHasTrackToChooseFrom
// only check for seeking gesture if on iPad , will overwrite last statements if true
if ([deviceType isEqualToString:@"iPad"] && location.y < 110) {
panType = VLCPanTypeSeek;
panType = VLCPanTypeSeek;
}
if ([_vpc currentMediaProjection] == VLCMediaProjectionEquiRectangular) {
if ([_vpc currentMediaIs360Video]) {
panType = VLCPanTypeProjection;
}
return panType;
return panType;
}
- (void)panRecognized:(UIPanGestureRecognizer*)panRecognizer
......@@ -1422,7 +1424,7 @@ currentMediaHasTrackToChooseFrom:(BOOL)currentMediaHasTrackToChooseFrom
_currentPanType = VLCPanTypeNone;
//Invalidate saved location when the gesture is ended
if ([_vpc currentMediaProjection] == VLCMediaProjectionEquiRectangular)
if ([_vpc currentMediaIs360Video])
_saveLocation = CGPointMake(-1.f, -1.f);
}
}
......@@ -1592,7 +1594,7 @@ currentMediaHasTrackToChooseFrom:(BOOL)currentMediaHasTrackToChooseFrom
- (BOOL)rotationIsDisabled
{
return _interfaceIsLocked;
return _interfaceIsLocked || [_vpc currentMediaIs360Video];
}
- (BOOL)shouldAutorotate
......
......@@ -80,9 +80,10 @@ currentMediaHasTrackToChooseFrom:(BOOL)currentMediaHasTrackToChooseFrom
@property (readonly) NSInteger numberOfVideoSubtitlesIndexes;
@property (readonly) NSInteger numberOfTitles;
@property (readonly) NSInteger numberOfChaptersForCurrentTitle;
@property (nonatomic, readonly) BOOL currentMediaHasTrackToChooseFrom;
@property (nonatomic, readwrite) BOOL fullscreenSessionRequested;
@property (nonatomic, readonly) BOOL isSeekable;
@property (assign, readonly) BOOL currentMediaHasTrackToChooseFrom;
@property (assign, readwrite) BOOL fullscreenSessionRequested;
@property (assign, readonly) BOOL isSeekable;
@property (assign, readonly) BOOL currentMediaIs360Video;
@property (readonly) NSNumber *playbackTime;
@property (nonatomic, readonly) NSDictionary *mediaOptionsDictionary;
@property (nonatomic, readonly) NSTimer* sleepTimer;
......
......@@ -968,6 +968,11 @@ typedef NS_ENUM(NSUInteger, VLCAspectRatio) {
return [_mediaPlayer updateViewpoint:yaw pitch:pitch roll:roll fov:fov absolute:absolute];
}
- (BOOL)currentMediaIs360Video
{
return [self currentMediaProjection] == VLCMediaProjectionEquiRectangular;
}
- (NSInteger)currentMediaProjection
{
VLCMedia *media = [_mediaPlayer media];
......
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