热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

Chrome会在加载页面上挂起许多

Ihaveapagewithmany<video>elementsinitarrangedoneaftertheother.我有一个页面,其中有许多

I have a page with many elements in it arranged one after the other.

我有一个页面,其中有许多

Lets says 100 for now. When I click on the web page, Chrome loads the first 25 and I can see the video images displayed Ok, but then it stops and the rest remain black. I also see the page is still loading, and I see chrome saying "In progress..." on the lower left side of the page.

让现在说100。当我点击网页时,Chrome会加载前25个,我可以看到显示的视频图像确定,但随后停止,其余部分保持黑色。我还看到页面仍在加载,我看到Chrome在页面的左下方显示“正在进行...”。

Mathematica graphics

Using firefox, I can load the same page with no problem. Also using IE 11, I can load the same page with no problem and all videos show fine.

使用firefox,我可以毫无问题地加载同一页面。同样使用IE 11,我可以加载相同的页面没有问题,所有视频显示正常。

In none of these cases I actually played the video yet. This is all just waiting for the page to fully load.

在这些情况中,我实际上还没有播放视频。这只是等待页面完全加载。

I am using local apache server on my PC. The setup is XAMPP software. So Apache is running on my PC, and I access my page using localhost.

我在我的电脑上使用本地apache服务器。设置是XAMPP软件。所以Apache在我的电脑上运行,我使用localhost访问我的页面。

Now here is the interesting thing I found. When I load the page using file:///C:/ URI, and use the same exact page, then now Chrome shows all the video elements just fine! None of them is black. They all display fine and I can play them with no problem.

现在这是我发现的有趣的事情。当我使用file:/// C:/ URI加载页面并使用相同的页面时,现在Chrome显示所有视频元素就好了!他们都不是黑人。它们都显示得很好,我可以毫无问题地播放它们。

The problem only shows up when using the apache server. So it is a buffering issue between the web server and the Chrome browser.

使用apache服务器时,只会出现此问题。因此,它是Web服务器和Chrome浏览器之间的缓冲问题。

I know it is a buffering issue since if I move one of the videos still showing black and put the link at the top of the page, and reload the page, then it is no longer black and it shows up. Nothing changed except the position of the tag. So it seems Chrome has a limit of how many video tags it can load in one page?

我知道这是一个缓冲问题,因为如果我移动其中一个仍显示黑色的视频并将链接放在页面顶部,然后重新加载页面,那么它就不再是黑色而且会显示出来。除了

I am using Chrome 36.0.1985.125 on windows 7.

我在Windows 7上使用Chrome 36.0.1985.125。

I tried to change the size of the video displayed using:

我尝试使用以下方法更改显示的视频大小:

video {
  width: 200px    !important;
  height: auto   !important;
}

But no matter what size I use in the above, it still hangs in the same place.

但无论我在上面使用什么尺寸,它仍然挂在同一个地方。

Any suggestions what to do? I could split the web page into many different pages as last resort.

有什么建议吗?我可以将网页分成许多不同的页面作为最后的手段。

This is windows 7, 64 bit. The video elements I use are all the same. Here is one example

这是Windows 7,64位。我使用的视频元素都是一样的。这是一个例子

  

As I said, changing the width and height makes no difference.

正如我所说,改变宽度和高度没有区别。

I looked at the log file for apache (access log file) and I see some 206 codes in there when I load the page from Chrome (206 is partial content). Here is example of one entry:

我查看了日志文件中的apache(访问日志文件),当我从Chrome加载页面时,我看到了大约206个代码(206是部分内容)。以下是一个条目的示例:

[11/Aug/2014:13:17:25 -0500] "GET /my_notes/movie.webm HTTP/1.1" 206 1768659 
 "http://localhost/my_notes/index.htm" "Mozilla/5.0 (Windows NT 6.1; WOW64) 
  AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.125 Safari/537.36"

When I load the same page from firefox and look at the apache log file, I do not see any 206 codes in there. From http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html it says:

当我从firefox加载相同的页面并查看apache日志文件时,我看不到任何206代码。来自http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html它说:

The server has fulfilled the partial GET request for the resource. The request MUST have included a Range header field (section 14.35) indicating the desired range, and MAY have included an If-Range header field (section 14.27) to make the request conditional.

服务器已完成对资源的部分GET请求。请求必须包含一个Range头字段(第14.35节),表示所需的范围,并且可能包含一个If-Range头字段(第14.27节)以使请求成为条件。

So it sounds like Chrome has a limit of the video it can request? Is this a known issue with Chrome?

所以听起来Chrome有可能要求的视频限制?这是Chrome的已知问题吗?

2 个解决方案

#1


20  

I found a solution that bypass this Chrome issue. Posting here in case someone else runs into the same problem.

我找到了一个绕过这个Chrome问题的解决方案。发布此处以防其他人遇到同样的问题。

Replaced All the

全部取代了

  

with

  

What the above does is suggest to the browser not to download the videos unless one clicks on the play button, then only that specific video is loaded. It places a poster image meanwhile so that the space is occupied by something and not empty.

以上操作建议浏览器不要下载视频,除非单击播放按钮,然后才加载该特定视频。它同时放置一张海报图像,以便空间被某物占据而不是空洞。

Now the web page loads fine in Chrome.

现在网页在Chrome中正常加载。

Chrome has a known bug creating multiple socket connections and not closing them. https://code.google.com/p/chromium/issues/detail?id=234779

Chrome有一个已知的错误,即创建多个套接字连接而不关闭它们。 https://code.google.com/p/chromium/issues/detail?id=234779

#2


0  

Same problem here, this is the best way to fix it

同样的问题,这是解决它的最佳方法

Replace

更换


To


推荐阅读
  • Python瓦片图下载、合并、绘图、标记的代码示例
    本文提供了Python瓦片图下载、合并、绘图、标记的代码示例,包括下载代码、多线程下载、图像处理等功能。通过参考geoserver,使用PIL、cv2、numpy、gdal、osr等库实现了瓦片图的下载、合并、绘图和标记功能。代码示例详细介绍了各个功能的实现方法,供读者参考使用。 ... [详细]
  • 这是原文链接:sendingformdata许多情况下,我们使用表单发送数据到服务器。服务器处理数据并返回响应给用户。这看起来很简单,但是 ... [详细]
  • 本文介绍了使用AJAX的POST请求实现数据修改功能的方法。通过ajax-post技术,可以实现在输入某个id后,通过ajax技术调用post.jsp修改具有该id记录的姓名的值。文章还提到了AJAX的概念和作用,以及使用async参数和open()方法的注意事项。同时强调了不推荐使用async=false的情况,并解释了JavaScript等待服务器响应的机制。 ... [详细]
  • CSS3选择器的使用方法详解,提高Web开发效率和精准度
    本文详细介绍了CSS3新增的选择器方法,包括属性选择器的使用。通过CSS3选择器,可以提高Web开发的效率和精准度,使得查找元素更加方便和快捷。同时,本文还对属性选择器的各种用法进行了详细解释,并给出了相应的代码示例。通过学习本文,读者可以更好地掌握CSS3选择器的使用方法,提升自己的Web开发能力。 ... [详细]
  • 本文介绍了Windows操作系统的版本及其特点,包括Windows 7系统的6个版本:Starter、Home Basic、Home Premium、Professional、Enterprise、Ultimate。Windows操作系统是微软公司研发的一套操作系统,具有人机操作性优异、支持的应用软件较多、对硬件支持良好等优点。Windows 7 Starter是功能最少的版本,缺乏Aero特效功能,没有64位支持,最初设计不能同时运行三个以上应用程序。 ... [详细]
  • 本文讨论了在手机移动端如何使用HTML5和JavaScript实现视频上传并压缩视频质量,或者降低手机摄像头拍摄质量的问题。作者指出HTML5和JavaScript无法直接压缩视频,只能通过将视频传送到服务器端由后端进行压缩。对于控制相机拍摄质量,只有使用JAVA编写Android客户端才能实现压缩。此外,作者还解释了在交作业时使用zip格式压缩包导致CSS文件和图片音乐丢失的原因,并提供了解决方法。最后,作者还介绍了一个用于处理图片的类,可以实现图片剪裁处理和生成缩略图的功能。 ... [详细]
  • 本文介绍了使用cacti监控mssql 2005运行资源情况的操作步骤,包括安装必要的工具和驱动,测试mssql的连接,配置监控脚本等。通过php连接mssql来获取SQL 2005性能计算器的值,实现对mssql的监控。详细的操作步骤和代码请参考附件。 ... [详细]
  • 本文由编程笔记小编整理,主要介绍了使用Junit和黄瓜进行自动化测试中步骤缺失的问题。文章首先介绍了使用cucumber和Junit创建Runner类的代码,然后详细说明了黄瓜功能中的步骤和Steps类的实现。本文对于需要使用Junit和黄瓜进行自动化测试的开发者具有一定的参考价值。摘要长度:187字。 ... [详细]
  • 本文介绍了响应式页面的概念和实现方式,包括针对不同终端制作特定页面和制作一个页面适应不同终端的显示。分析了两种实现方式的优缺点,提出了选择方案的建议。同时,对于响应式页面的需求和背景进行了讨论,解释了为什么需要响应式页面。 ... [详细]
  • 如何在php文件中添加图片?
    本文详细解答了如何在php文件中添加图片的问题,包括插入图片的代码、使用PHPword在载入模板中插入图片的方法,以及使用gd库生成不同类型的图像文件的示例。同时还介绍了如何生成一个正方形文件的步骤。希望对大家有所帮助。 ... [详细]
  • 本文介绍了如何使用php限制数据库插入的条数并显示每次插入数据库之间的数据数目,以及避免重复提交的方法。同时还介绍了如何限制某一个数据库用户的并发连接数,以及设置数据库的连接数和连接超时时间的方法。最后提供了一些关于浏览器在线用户数和数据库连接数量比例的参考值。 ... [详细]
  • 本文介绍了使用postman进行接口测试的方法,以测试用户管理模块为例。首先需要下载并安装postman,然后创建基本的请求并填写用户名密码进行登录测试。接下来可以进行用户查询和新增的测试。在新增时,可以进行异常测试,包括用户名超长和输入特殊字符的情况。通过测试发现后台没有对参数长度和特殊字符进行检查和过滤。 ... [详细]
  • javascript  – 概述在Firefox上无法正常工作
    我试图提出一些自定义大纲,以达到一些Web可访问性建议.但我不能用Firefox制作.这就是它在Chrome上的外观:而那个图标实际上是一个锚点.在Firefox上,它只概述了整个 ... [详细]
  • 知识图谱——机器大脑中的知识库
    本文介绍了知识图谱在机器大脑中的应用,以及搜索引擎在知识图谱方面的发展。以谷歌知识图谱为例,说明了知识图谱的智能化特点。通过搜索引擎用户可以获取更加智能化的答案,如搜索关键词"Marie Curie",会得到居里夫人的详细信息以及与之相关的历史人物。知识图谱的出现引起了搜索引擎行业的变革,不仅美国的微软必应,中国的百度、搜狗等搜索引擎公司也纷纷推出了自己的知识图谱。 ... [详细]
  • 十大经典排序算法动图演示+Python实现
    本文介绍了十大经典排序算法的原理、演示和Python实现。排序算法分为内部排序和外部排序,常见的内部排序算法有插入排序、希尔排序、选择排序、冒泡排序、归并排序、快速排序、堆排序、基数排序等。文章还解释了时间复杂度和稳定性的概念,并提供了相关的名词解释。 ... [详细]
author-avatar
再度重相逢jc_866
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有