如何阻止我的mediaelement.js播放器在暂停/停止时下载? [英] How do I stop my mediaelement.js player from downloading when it is paused/stopped?

查看:238
本文介绍了如何阻止我的mediaelement.js播放器在暂停/停止时下载?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的网站上有一个视频播放器,一旦暂停,我想阻止其他视频下载。我正在使用 MediaElement.js 的HTML5视频与闪回fallback。这是令人讨厌的,我无法停止下载的视频,因为它是一个浪费带宽和进展事件继续触发和更新用户界面。

I have a video player on my site that once paused I would like to prevent rest of the video being downloaded. I am using MediaElement.js for html5 video with flash fallback. It is annoying that I am unable to stop the video from downloading as it is a waste of bandwidth and the "progress" event continues to fire and update the UI.

推荐答案

不幸的是,没有办法告诉浏览器停止下载视频文件,然后在同一时间恢复。在HTML5规范中,它会很好,但它不是。

Unfortunately, there is no way to tell browsers to stop downloading a video file and then resume it later at the same point. It'd be nice it that were in the HTML5 spec, but it's not.

你可以尝试使用'paused'来设置播放器的.src文件到'',然后当'play'事件触发时,您可以将src设置回URL。但我的猜测是,你会失去已经下载的东西。

You could try hacking around using the 'paused' to set the .src of the player to '', and then when the 'play' event fires, you could set the src back to the URL. But my guess is that you'd lose what was already downloaded.

这篇关于如何阻止我的mediaelement.js播放器在暂停/停止时下载?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆