Xcode 7を使用していて、クイックルック機能を使用しています。ここは「fileURL」のためのクイックルックデータを読み込むことができませんでしたと言う私のコード //こちらのライン@fileは、このような私のfileURLの端に取り付けます下回るのである -"fileURL"のクイックルックデータをロードできませんでした。fileURLWithPathメソッドのためAVPlayerビデオを再生できません。
@"http:/example.com/some_clips/SHAINA%20NC%20NEWS%20X%20180516%201657PM.mp4 -- file:///" see here something file:/// in the end so because of this i am unable to play video.
私はinitWithStringを使用している場合と、 URLを直接入力してもエラーは表示されません。私の下のプレーヤーにURLを設定するための何かを提案してください。作成したコードでもコメントを読んでください。誰もがこれについて考えているのですか?
あなたが使用する必要がありますNSString *localfilepath=[NSString stringWithFormat:@"%@",[managedObject valueForKey:@"clip_path"]]; //here i am getting my URL path upto .mp4 but after below line word -- file gets attached to it because of fileURLWithPath method don't know how to convert that
NSURL *fileURL = [NSURL fileURLWithPath:localfilepath]; //suggest me this line of code so that i can pass URL to the player here this method is not working
// create a player
player = [AVPlayer playerWithURL:fileURL]; //here this fileURL which is going to player is going with that file:/// so giving error and no video runs
AVPlayerViewController *controller = [[AVPlayerViewController alloc] init];
[self addChildViewController:controller];
[self.view addSubview:controller.view];
controller.view.frame = CGRectMake(10,80,300,300);
controller.player = player;
controller.showsPlaybackControls = YES;
[player pause];
を作成した'クラスを? – Larme
それはコアデータのクリップのパスですどこからURLの@Larmeを取得しています – vicky
私はそれを作った:)私はみんな:) :)この答えに – vicky