Reply
Visitor
kofc
Posts: 1
Registered: ‎01-19-2012
0 Kudos

Download Link on html page.

We are using the same Rendition URL to set up a
Download link, and it looks like this

"http://brightcove.vo.llnwd.net/pd19/media/802593642001/802593642001_1328016361001_Rome-2011-H264-128..."

When we click on it , it opens the video in a new window and plays it. I do
not want this Rather I want link to popup window asking to save the file to the local machine. How can
this be achieved?

 

Thank You

Regular Contributor
HG
Posts: 104
Registered: ‎07-19-2011
0 Kudos

Re: Download Link on html page.

You have to use some sort of proxy to enable this, it may be done with ASP/PHP/CF or so, you can also do a search to acomplish this with pure JavaScript either plain or with jQuery, Mootools, YUI or so...

 

Brightcove Team
BC-Iceman
Posts: 101
Registered: ‎10-22-2009
0 Kudos

Re: Download Link on html page.

 

Only firefox renders the sweet download links. Remember, invoking the API is basically returning XML - and each browser has their own way of rendering the content. You need to do some programming to make the magic happen. 

 

-Iceman

New Member
carlosLH
Posts: 1
Registered: ‎01-25-2012
0 Kudos

Re: Download Link on html page.

This is interesting, if i were hosting this video on my server, I would add the content-disposition flag to the response headers to force the different browsers to download the video, instead of trying to play it. I'm having the same issue, can someone point me to an example of this custom code proxy you are referring to above?

Visitor
alexander
Posts: 2
Registered: ‎04-05-2012
0 Kudos

Re: Download Link on html page.

Hello,

I would like to ask this question again.

 

The only way I know to force browsers to save .mp4 videos to disk is to send content-disposition:attachment header from the server. http://brightcove.vo.llnwd.net/ server does not serve this header with .mp4 files, so our users see a video playing in a new window, instead of being downloaded.

 

Is there any way to ask http://brightcove.vo.llnwd.net/ server to add content-disposition:attachment header? Perhaps with a query string parameter?

 

The workaround involving a proxy that you mentioned is of course insufficient, because it will require huge bandwidth on this proxy server. I don't know which Javascript solution HG mentions, but the only one I heard of (SaveAs function) is IE-only and does not work in modern browsers.

 

Thank you,

Alexander

Regular Contributor
HG
Posts: 104
Registered: ‎07-19-2011
0 Kudos

Re: Download Link on html page.

Alexander,

 

great idea on adding the content-disposition:attachment header with a query string. Lets see what brightcove has to say about that.

 

Not sure how using a proxy would involve a huge bandwidth impact on the server since you would only be pinging the server for a few bites to help you download the MP4 which then will be downloaded from BrightCove. Here is a quick dirty PHP sample to get you started using the file pointed out at the begining of the thread:

 

<?php

$url = "http://brightcove.vo.llnwd.net/pd19/media/802593642001/802593642001_1328016361001_Rome-2011-H264-128...";

header('Content-type: application/$ext');
header('Content-Disposition: attachment; filename="romedemo.mp4"');

echo file_get_contents($url);

 

On a similar note, my JavaScript suggestion was JS -> proxy -> brightcove -> back to proxy - back to user. You still would need a proxy server but I was talking about that extra on my suggestion.

 

I hope this helps.

Visitor
alexander
Posts: 2
Registered: ‎04-05-2012
0 Kudos

Re: Download Link on html page.

Hi HG,

 

Correct me if I'm wrong, but file_get_contents($url) will attempt to load the whole file located at $url into web-server memory. Because the full-size videos are anywhere from 100Mb up, this will either time-out, or consume all available memory on the web server and crash.

I'm not aware of any mechanism in HTTP by which web server can reply to the browser "please take these content-disposition headers, but then issue another HTTP request to the Brightcove server and load actual video directly from there".

 

As for JavaScript suggestion, could you elaborate a little bit please, at which point would you add the headers? You cannot do it in Javascript, and if you are doing it on the web server, you still have the same issue to first download the whole video to the web server, and then to send it to browser.

 

Alexander