首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Google VR视图-设置视频类型

Google VR视图-设置视频类型
EN

Stack Overflow用户
提问于 2016-07-12 03:16:15
回答 0查看 827关注 0票数 1

因此,我正在尝试使用谷歌的VR SDK来播放我的应用程序中的视频,但我遇到了一些问题。尽管有文档,但我们似乎不能再设置视频的类型,所以我让视频像这样显示:

我根本不能移动它,就像我应该能做的那样。此外,全屏模式的参数似乎不起作用。有没有人知道如何解决这个问题?这是我使用的代码:

代码语言:javascript
复制
#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
EN

回答

页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/38314509

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档