casatwy/CTVideoPlayerView

Video longer than 10 seconds throw error

Opened this issue · 21 comments

can you give me the url of the video you tested?

https://backend.OBSCURED.com:1337/parse/files/OBSCURED/a2d8aec7a78231c8c73eb2a8002283a7_PF-VID-2017-11-23T22-06-10AEDT.mov

This is one of many videos all doing the same thing. It is only happening on videos longer than 10 seconds. I have verified this with a table view of over 100 records as wel as just a uiviewcontroller with one video in it

Any update on this?

im still working on it

Thank you. Are you able to reproduce the issue or did you need me to help out some how?

Anything further? I'm considering moving away from this library however really don't want to.

sorry for my late replay, seems that the url is not available now?

Works on this end mate......try clicking it and it will load. If not post a photo of the error you're receiving

I can download it with curl, but can not play it with safari, I will try to download it, and play it with my library, to see wether your issue will happen again

That seems to be an issue specific to either safari or your machine/network. I am using chrome and it works through a browser.

I played the downloaded video with my library, it works fine, but can not play it remotely. I have pushed my code to GitHub.

when you run my project, the Single Remote Video will play the url you gave me, it not even play.

the Single Native Video will play the video that I download from your URL, it works fine.

I think it could be a networking issue, I will try to dig it more.

I have tried other library such as MD360Player4iOS, the issue keeps.

now I think it could be a issue of the video, could you tell me how you created this video?

Maybe some problem with the compression process caused this. Because the error says that "content range mismatch".

both CTVideoPlayerView and MD360Player4iOS reported the same error.

I've already noted that error on the StackOverflow link I sent through. I thought the same thing.

My compression code is below:

AVURLAsset *urlAsset = [AVURLAsset URLAssetWithURL:inputURL options:nil]; AVAssetExportSession *exportSession = [[AVAssetExportSession alloc] initWithAsset:urlAsset presetName:AVAssetExportPresetMediumQuality]; exportSession.outputURL = outputURL; exportSession.outputFileType = AVFileTypeQuickTimeMovie; exportSession.shouldOptimizeForNetworkUse = YES; [exportSession exportAsynchronouslyWithCompletionHandler:^{ completion(exportSession); }];

do you have the origin video?I want to write a new compress code to test it.

you can send the video file to my email: casatwy@msn.com

ok

seems that your compress code have no problem.

I just ran the LLSimpleCamera. After I finished video recording, I fetched the video file that LLSimpleCamera just recorded and find out that it can not play by QuickTime.

And I switched to the UIImagePickerController to record the video, it totally works fine.

my suggestion is that you can consider switch to the official video recording tool: UIImagePickerController. It is also highly customizable, you can check the official document for more detail.

I posted the test code in this repo, and the video recording code in a new view controller:VideoRecordViewController.

in the Supporting Files there is origin.mov which comes from LLSimpleCamera, and ImagePickerOrigin.MOV which comes from UIImagePickerController.

I don't know why LLSimpleCamera have this issue, but UIImagePickerController works well.

here is a tip if you want to get the video file your device just recorded, you can

  1. open Window in XCode
  2. select 'Devices and Simulators',
  3. select the device in the left, and select the Installed Apps in the right
  4. click the setting gear and select Download Container
  5. double finger tap the package you just downloaded, and select Show package contents, you can find the video the device just recorded somewhere in this directory.

hope this is useful to you.

I resolved this issue myself. The server needs to send byte-range headers for the library and iOS 10+ to work with streaming protocols.

I suggest you add this to your README or implement support to download then watch instead of streaming.

@Xenero thank you for your help! I'm really appreciate what you have done on this issue!

CTVideoPlayerView do support "download" , there is a category named 'download' for CTVideoView:

https://github.com/casatwy/CTVideoPlayerView/blob/master/CTVideoView/CTVideoView/Categories/CTVideoView/Download/CTVideoView%2BDownload.h

and this project has a demo for "download then play":

https://github.com/casatwy/CTVideoPlayerView/tree/master/CTVideoView/DemoControllers/DownloadThenPlay

just run this project (run pod update first), and you will see the "MP4 Download Then Play" in the table view.