Can't play audio or video from url

We are integrating our app from Parse to Backendless. We have a fully functional ChatSDK which enables users to send audio, video and image messages.

We mainly used Parse for storing the data files meaning users could quickly stream them by downloading the file from a URL. The issue is that audio and video files don’t seem to play even when saved and used in exactly the same way as their Parse alternatives.

I have checked the permissions in my dashboard and they are all set to enable audio and video streaming. I have also found this answer but it doesn’t clearly explain the problem (it is also in swift and not objective-C)

Currently the video code looks like this:

_videoPlayer = [[MPMoviePlayerController alloc] initWithContentURL:url];

// Set control style to default

_videoPlayer.controlStyle = MPMovieControlStyleDefault;


_videoPlayer.shouldAutoplay = YES;

[self.view addSubview:_videoPlayer.view];

[_videoPlayer setFullscreen:YES animated:YES];

I don’t see why switching to a Backendless URL would not work or how this could be a problem with the code. Similarly with the audio code, we load it from a URL and it works with Parse but not with Backendless.

Any help would be very appreciated,

Simon

Hi Simon,

Would it be possible for you to check if the HTTP response headers from Parse are different than the ones you get with Backendless?

Regards,
Mark

Hi Mark,

There is no easy way to monitor the response headers from Parse short of connecting to the iPhone via a proxy and using a network monitor tool to intercept them.

Do you think the devs will be able to look into this issue in the near future? We will be migrating around 500 clients across to Backendless so we want to be sure that we can support our core products once we commit to Backendless as a product.

Thanks,

Simon

Hi Simon,

All it would take is to fetch a media file from Parse in a browser and check the response headers.

We will get to it, but if you could help, it would facilitate and help us speed things up.

Regards,
Mark

Hi Mark,

We are happy to help out but I don’t really know how I would go about doing this. There are quite a few different answers on Stackoverflow. Could I analyse it using the Firefox extension httpfox?

We are getting closer to our handover date from Parse to Backendless so really need to have this fixed as soon as possible.

If you can give me information on how to go about it I will do what I can to help out,

Simon

Hi Mark

Please, is there any work around for the above issue because i am in the same situation now. Will appreciate if you help me out. Thanks. { Can’t play audio or video from url of files store on backendless}

Do you use public URL for playing media?
Header may be seen in Browsers console on Network tab. Please firstly compare the content type header of files got from Parse and Backendless.

Hi Arthur

streaming works perfectly with this url from mymusiccloud.com; http://mymusicclouds3-a.akamaihd.net/prod/1035095/0/4.mp3 but not with the mp3 file from backendless https://api.backendless.com/B32F410D-21F0-2A8C-FF9F-63E74EC3F700/v1/files/media/wi.mp3 I will appreciate if you detect what i actually is causing this on you servers.

Regards

Ps Jimmy

I suppose, it may be related to the fact that mymusiccloud sets Content-Type header to audio/mpeg, while we set it to a broader one, which is application/octet-stream.

Have you tried setting up our samples from the documentation, do they work for you?

I have not tried setting up any sample from your documentation. I didn’t see docs for android media streaming when i started the project so I am using a different media player which works for all files expect those stored on backendless.
Please can i have the link to the sample docs you are talking about?
Can’t I play files with octet-stream headers using any other media player apart from those in your docs?..Just asking

You can generate the sample in the Code Generation tab on developer’s console.

Maybe your player needs some additional configurations to work with our service, but this is not covered by support due to our Support Policy.