Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to stream Video using PFFile #3690

Closed
wooknight opened this issue Apr 5, 2017 · 15 comments
Closed

Unable to stream Video using PFFile #3690

wooknight opened this issue Apr 5, 2017 · 15 comments

Comments

@wooknight
Copy link

wooknight commented Apr 5, 2017

http://stackoverflow.com/questions/43360204/unable-to-view-videos-in-ios-app-uploaded-to-heroku-s3-via-parse-server

I would be grateful for any pointers here

@ZacharyKhan
Copy link

Check #1440, may help your situation.

@natanrolnik
Copy link
Contributor

Closing as duplicate of #1440, #326, #692, #2127, #1698 and #1973
@wooknight hope you got it working.

@wooknight
Copy link
Author

@ZacharyKhan
I did check #1440 and updated my parse server to 2.3.7 which according to @gfosco does have the updates that I need but it has not solved the issue at all

@natanrolnik
I know it sounds like a duplicate but I have updated my parse server . I have updated my Parse IOS SDK and I still get the same issue . I pinged the original authors if they could document their steps but have not received a response

@ZacharyKhan
Copy link

ZacharyKhan commented Jul 9, 2017

I was able to get this to work a while ago using amazon S3 to store the video files. Basically, store the video as a PFFile and make sure to set the mime type for MP4.

Then, when retrieving a video file, get the URL string from the pffile and load the video into your player.

@wooknight
Copy link
Author

@ZacharyKhan
Truly appreciate you taking the time here . I will try those steps and get back to you

@ZacharyKhan
Copy link

@wooknight no problem. Posting your code/errors also would help :)

@wooknight
Copy link
Author

@ZacharyKhan . Thank you again . This is the code that uploads the file

file = [PFFile fileWithData:videoContentData contentType:@"video/mp4"];
       [selectedExperienceObject setObject:file forKey:@"video_comment"];
       MPMoviePlayerController *player = [[MPMoviePlayerController alloc] initWithContentURL:self.videoURL];
       player.shouldAutoplay = NO;

This is a file that was uploaded to S3

https://s3-us-west-1.amazonaws.com/speedrate/37c02e3efb521608326fdb6577c92c83_file.mp4

I am still not sure what I am missing here. Thank you for your help

@flovilmart
Copy link
Contributor

What’s the content type header on the file on S3?

@wooknight
Copy link
Author

wooknight commented Jul 16, 2017 via email

@flovilmart
Copy link
Contributor

Image doesn’t seem uploaded.

@wooknight
Copy link
Author

Thank you for taking the time to help with this

mp4header

This is the file on S3

https://s3-us-west-1.amazonaws.com/speedrate/4ab48fc8a45f1eee32b477b4ad4152ba_file.mp4

@flovilmart
Copy link
Contributor

I’m able to open the file in safari (iOS 11) so it should work right from the URL as AVURLAsset in AVPlayer

@flovilmart
Copy link
Contributor

Or MPMoviePlayerController given that the URL is calid

@wooknight
Copy link
Author

Thanks Flo . I am running this on Heroku so the url that I get back is as follows

http://speedrate.herokuapp.com/parse/files/JouG4uxCS5XxQ8Q7VCH9Z8mqnxbAXh3HkMSoEuHc/47f20cc4d8f1818f6c88fc82b30a3213_file.mp4

and while that URL shows up fine on other browsers , it does not show up in Safari . I tried the equivalent S3 url
https://s3-us-west-1.amazonaws.com/speedrate/47f20cc4d8f1818f6c88fc82b30a3213_file.mp4
It runs fine in Safari ( and all the other browsers)

Do I need to replace the URL inside the IOS code ? before playing the video ?

Thanks for your help

@flovilmart
Copy link
Contributor

You should probably configure parseServer and the S3 adapter for direct access so all URL's will be pointing to S3 directly instead of parse-server.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants