嗨,我正在为一个需要我从服务器播放视频的 uni 项目创建一个应用程序。我决定使用 Dropbox。但是它不会播放文件,我有什么办法可以做到吗?还是我需要从其他地方获取视频。
我试过另一个链接,它工作得很好。(但不是保管箱)
http://www.jplayer.org/video/m4v/Big_Buck_Bunny_Trailer.m4v
我的编码如下
AnimeWatchViewController.m
//
// AnimeWatchViewController.m
// VideoPlayer
//
// Created by Alex Lee on 27/04/2014.
// Copyright (c) 2014 Alex Lee. All rights reserved.
//
#import "AnimeWatchViewController.h"
@interface AnimeWatchViewController ()
@end
@implementation AnimeWatchViewController
@synthesize moviePlayer;
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
}
-(IBAction)playMovie{
NSURL * url =[[NSURL alloc] initWithString:@"https://www.dropbox.com/s/t05zdw2woogo4kh/ACW_3.mp4"];
moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:url];
[moviePlayer.view setFrame:CGRectMake(20, 100, 275, 150)];
[self.view addSubview:moviePlayer.view];
moviePlayer.fullscreen …Run Code Online (Sandbox Code Playgroud)