简体   繁体   中英

Streaming stops In Windows Safari VLC web plugin

I am having an issue with Video streaming on vlc plugin in Windows safari. I have added windowless="true" attribute in embed tag so that I can display transparent DIV above vlc plug in for Drawing on video. 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. Issue is observed in windows safari only with windowless="true".

I have the exactly same behavior. 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. 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. 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.

Yes, it's an ugly hack but it works as a short term solution.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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