Firefox - 使用Iframe下载Http播放视频文件

时间:2013-07-03 01:41:26

标签: javascript firefox iframe

在Firefox中,我使用此代码从服务器下载.Mp4文件。 但是在Firefox中,插件已经在OPTIONS / APPLICATION选项卡中设置,以便在Quicktime中打开它。

结果是文件在隐藏的iframe中下载并开始播放。 我想下载文件而不是直接播放文件。

如何设置它以便打开另存为对话框而不是播放。 我如何从服务器控制这种行为。

        var hiddenIFrameID = 'hiddenDownloader',
        iframe = document.getElementById(hiddenIFrameID);

        if (iframe === null) {
            iframe = document.createElement('iframe');
            iframe.id = hiddenIFrameID;
            iframe.style.display = 'none';
            document.body.appendChild(iframe);
        }
        iframe.src = signedUrl;

0 个答案:

没有答案
相关问题