gpt4 book ai didi

ios - Google VR View -设置视频类型

转载 作者:行者123 更新时间:2023-12-01 20:07:58 25 4
gpt4 key购买 nike

因此,我尝试使用Google的VR SDK在我的应用中播放视频,但遇到了一些问题。尽管有文档说明,但似乎我们无法再设置视频类型,因此我得到的视频显示如下:enter image description here

我根本无法像应该那样移动它。此外,用于全屏模式的参数似乎不起作用。有谁知道如何解决?这是我正在使用的代码:

#import <UIKit/UIKit.h>
#import "NewViewController.h"
#import "GVRVideoView.h"


@interface NewViewController ()
@property (nonatomic) IBOutlet GVRVideoView *viewView;



@end

@implementation NewViewController {
BOOL _isPaused;
}

- (instancetype)init {
self = [super initWithNibName:nil bundle:nil];
return self;
}


- (void)viewDidLoad {
[super viewDidLoad];

_viewView.enableFullscreenButton = YES;
_viewView.enableCardboardButton = YES;

_isPaused = true;

// Load the sample 360 video, which is of type stereo-over-under.
NSString *videoPath = [[NSBundle mainBundle] pathForResource:@"congo" ofType:@"mp4"];
[_viewView loadFromUrl:[[NSURL alloc] initFileURLWithPath:videoPath]];


}



#pragma mark - GVRVideoViewDelegate

- (void)widgetViewDidTap:(GVRWidgetView *)widgetView {
if (_isPaused) {
[_viewView resume];
} else {
[_viewView pause];
}
_isPaused = !_isPaused;
}

- (void)widgetView:(GVRWidgetView *)widgetView didLoadContent:(id)content {
NSLog(@"Finished loading video");
}

- (void)widgetView:(GVRWidgetView *)widgetView
didFailToLoadContent:(id)content
withErrorMessage:(NSString *)errorMessage {
NSLog(@"Failed to load video: %@", errorMessage);
}

- (void)videoView:(GVRVideoView*)videoView didUpdatePosition:(NSTimeInterval)position {
// Loop the video when it reaches the end.
if (position == videoView.duration) {
[videoView seekTo:0];
[videoView resume];
}
}

@end

最佳答案

即使我也面临着同样的问题
所以我改变了

options.inputType = Options.TYPE_STEREO_OVER_UNDER;


Options options = new Options();
options.inputType = Options.TYPE_MONO;

所以视频现在可以正常工作了

关于ios - Google VR View -设置视频类型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38314509/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com