简体   繁体   English

流停止在Windows Safari VLC Web插件中

[英]Streaming stops In Windows Safari VLC web plugin

I am having an issue with Video streaming on vlc plugin in Windows safari. 我在Windows野生动物园的vlc插件上使用视频流时遇到了问题。 I have added windowless="true" attribute in embed tag so that I can display transparent DIV above vlc plug in for Drawing on video. 我在embed标签中添加了windowless =“ true”属性,以便可以在视频绘图上的vlc插件上方显示透明DIV。 After adding this tag video is stopped and video frame is not received. 添加此标签后,视频将停止并且无法接收视频帧。 But When I click on video or draw something on video, video frame refreshed for a while. 但是,当我单击视频或在视频上绘制内容时,视频帧会刷新一段时间。 Even if when I remove windowless="true" attribute video works. 即使我删除windowless =“ true”属性,视频也可以正常工作。 Issue is observed in windows safari only with windowless="true". 仅使用windowless =“ true”在Windows野生动物园中观察到问题。

I have the exactly same behavior. 我有完全相同的行为。 Windows 10, Safari 5.1.7. Windows 10,Safari 5.1.7。

So far the only solution I found is a workaround to force browser updating the player's frame. 到目前为止,我发现的唯一解决方案是强制浏览器更新播放器框架的解决方法。 I do it by quickly adding and removing a "glass" div: a region that occupies whole browser's screen and has an opaque background fill color. 我通过快速添加和删除“玻璃” div来做到这一点:该区域占据整个浏览器的屏幕,并且具有不透明的背景填充颜色。 Since it's transparent there is no any visible changes on the screen but Safari always redraws overlapped regions even if they are overlapped by a transparent pane. 由于它是透明的,因此屏幕上没有任何可见的变化,但是Safari始终会重绘重叠的区域,即使它们被透明窗格重叠也是如此。 Here is what I do: 这是我的工作:

 function play() { // ...create player, set properties, etc. // assuming player taking whole browser's screen. // It's a glass pane - it should cover whole player's output surface. var glass = $('<div>'); $('body').append(glass); // Here we start updating... setInterval(function() { $('body').toggleClass('glass'); }, 20); // <== 1000ms / 30fps = 33ms, put 20ms just in case. } 
 .glass { position: absolute; width: 100%; height: 100%; z-index: 10000; background-color: rgba(40,1,1,0); } 

Of course, you need to adjust z-index so what glass is overlapping player surface but not blocking your custom controls. 当然,您需要调整z-index以使玻璃覆盖播放器表面但不会阻塞自定义控件。

Yes, it's an ugly hack but it works as a short term solution. 是的,这是一个丑陋的破解,但可以作为短期解决方案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM