科尔多瓦IOS 13.6.1视频不模糊

时间:2020-09-04 15:21:32

标签: javascript html css ios webrtc

我在我们的Cordova IOS / Android应用程序中将Cordova插件(https://github.com/cordova-rtc/cordova-plugin-iosrtc)与https://apirtc.com/产品一起用于WebRTC。当应用程序进入后台(已最小化)时,我正在从一个客户端向另一客户端发送一条消息(该应用程序已最小化),因此未最小化的客户端会模糊其应用程序已最小化的客户端的视频。 我有这个HTML,我可以在其中放置本地和远程视频

<div class="videosArea">
<div id="remote-container"></div>
<div id="local-container"></div>
</div>

我也有正在申请的CSS

.blur-on-minimize {
opacity: 0.5;
filter: blur(10px);
-webkit-filter: blur(10px);
-moz-filter: blur(10px);
-o-filter: blur(10px);
-ms-filter: blur(10px);
}

在JS中,我有这段代码可以处理应用程序的最小化

session.on('contactMessage', function(e) {
if (e.content === 'VideoPaused') {
   $( "#remote-container" ).addClass( "blur-on-minimize" )
   // $( "#remote-container" ).hide()
}  else if (e.content === 'VideoResumed') {
   $( "#remote-container" ).removeClass( "blur-on-minimize" )
   // $( "#remote-container" ).show()
}
   Logger.info(`Received message ${e.content} from ${e.sender.getId()}`)
});

这种添加和删除类的方法不适用于IOS元素,但在浏览器和Android上正常运行。

知道为什么会这样吗?

更新:我也尝试添加类

.blur-on-minimize {
    display:none;
}

根据下面的文档。看来这在IOS上仍然不起作用 https://github.com/cordova-rtc/cordova-plugin-iosrtc/blob/master/docs/videoCSS.md

1 个答案:

答案 0 :(得分:0)

我通过调用IOS的刷新功能解决了这个问题 https://github.com/cordova-rtc/cordova-plugin-iosrtc/blob/master/docs/iosrtc.md#iosrtcrefreshvideos

session.on('contactMessage', function(e) {
                    if (e.content === 'VideoPaused') {
                        $( "#remote-container video" ).addClass( "blur-on-minimize" )
                        if (Meteor.isCordova && Meteor.isIos) {
                            cordova.plugins.iosrtc.refreshVideos()
                        }
                    } else if (e.content === 'VideoResumed') {
                        $( "#remote-container video" ).removeClass( "blur-on-minimize" )
                        if (Meteor.isCordova && Meteor.isIos) {
                            cordova.plugins.iosrtc.refreshVideos()
                        }
                    }
                    Logger.info(`Received message ${e.content} from ${e.sender.getId()}`)
                });

请记住,无法进行模糊处理,您只能执行此处列出的属性 https://github.com/cordova-rtc/cordova-plugin-iosrtc/blob/master/docs/videoCSS.md