99 * @license For commercial or closed source, contact us at [email protected] or purchase directly via CodeCanyon 1010 * @license CodeCanyon: https://codecanyon.net/item/mirotalk-sfu-webrtc-realtime-video-conferences/40769970
1111 * @author Miroslav Pejic - [email protected] 12- * @version 1.9.73
12+ * @version 1.9.74
1313 *
1414 */
1515
@@ -3078,6 +3078,7 @@ class RoomClient {
30783078
30793079 eVc = document . createElement ( 'div' ) ;
30803080 eVc . className = 'expand-video-content' ;
3081+ eVc . id = id + '_videoExpandContent' ;
30813082
30823083 pip = this . createButton ( id + '__pictureInPicture' , html . pip ) ;
30833084 mv = this . createButton ( id + '__videoMirror' , html . mirror ) ;
@@ -3182,8 +3183,7 @@ class RoomClient {
31823183
31833184 this . isVideoPictureInPictureSupported && this . handlePIP ( elem . id , pip . id ) ;
31843185 this . isVideoFullScreenSupported && this . handleFS ( elem . id , fs . id ) ;
3185- this . handleVBEC ( eBtn , eVc , vb , d ) ;
3186- this . handleVB ( d . id , vb . id ) ;
3186+ this . handleVB ( d . id , vb . id , eBtn . id , eVc . id ) ;
31873187 this . handleDD ( elem . id , remotePeerId ) ;
31883188 this . handleTS ( elem . id , ts . id ) ;
31893189 this . handleMV ( elem . id , mv . id ) ;
@@ -4606,28 +4606,33 @@ class RoomClient {
46064606 // HANDLE VIDEO AND MENU BAR
46074607 // ####################################################
46084608
4609- handleVBEC ( eBtn , eVc , vb , d ) {
4610- const showDropdown = ( ) => eVc . classList . add ( 'show' ) ;
4611- const hideDropdown = ( ) => eVc . classList . remove ( 'show' ) ;
4612- const hideVideoBar = ( ) => hide ( vb ) && hideDropdown ( ) ;
4613- if ( ! this . isMobileDevice ) {
4614- eBtn . addEventListener ( 'mouseenter' , showDropdown ) ;
4615- eBtn . addEventListener ( 'mouseleave' , hideDropdown ) ;
4616- eVc . addEventListener ( 'mouseenter' , showDropdown ) ;
4617- eVc . addEventListener ( 'mouseleave' , hideDropdown ) ;
4618- d . addEventListener ( 'mouseleave' , hideDropdown ) ;
4619- } else {
4620- eBtn . addEventListener ( 'click' , showDropdown ) ;
4621- eVc . addEventListener ( 'click' , showDropdown ) ;
4622- }
4623- document . addEventListener ( 'click' , hideVideoBar ) ;
4624- }
4625-
4626- handleVB ( videoId , videoBarId ) {
4609+ handleVB ( videoId , videoBarId , eBtnId = null , eVcId = null ) {
46274610 const videoPlayer = this . getId ( videoId ) ;
46284611 const videoBar = this . getId ( videoBarId ) ;
4612+ const eBtn = this . getId ( eBtnId ) ;
4613+ const eVc = this . getId ( eVcId ) ;
4614+
4615+ if ( eBtn && eVc ) {
4616+ const showDropdown = ( ) => eVc . classList . add ( 'show' ) ;
4617+ const hideDropdown = ( ) => eVc . classList . remove ( 'show' ) ;
4618+
4619+ const handleDocumentClick = ( e ) => {
4620+ if ( ! eBtn . contains ( e . target ) && ! eVc . contains ( e . target ) ) {
4621+ hideDropdown ( ) ;
4622+ }
4623+ } ;
4624+
4625+ if ( this . isDesktopDevice ) {
4626+ eBtn . addEventListener ( 'mouseenter' , showDropdown ) ;
4627+ eVc . addEventListener ( 'mouseleave' , hideDropdown ) ;
4628+ } else {
4629+ eBtn . addEventListener ( 'click' , showDropdown ) ;
4630+ document . addEventListener ( 'click' , handleDocumentClick ) ;
4631+ }
4632+ }
4633+
46294634 if ( videoPlayer && videoBar ) {
4630- const eventType = this . isMobileDevice ? 'click ' : 'mouseenter ' ;
4635+ const eventType = this . isDesktopDevice ? 'mouseenter ' : 'click ' ;
46314636 videoPlayer . addEventListener ( eventType , async ( ) => {
46324637 hideVideoMenuBar ( videoBarId ) ;
46334638 rc . resizeVideoMenuBar ( ) ;
@@ -4641,12 +4646,18 @@ class RoomClient {
46414646 videoPlayer . style . setProperty ( 'border' , 'var(--videoBar-active)' , 'important' ) ;
46424647 }
46434648 } else {
4644- animateCSS ( videoBar , 'fadeOutUp' ) . then ( ( msg ) => {
4649+ animateCSS ( videoBar , 'fadeOutUp' ) . then ( ( ) => {
46454650 hide ( videoBar ) ;
46464651 } ) ;
46474652 videoPlayer . style . setProperty ( 'border' , 'none' , 'important' ) ;
46484653 }
46494654 } ) ;
4655+ if ( this . isDesktopDevice ) {
4656+ videoPlayer . addEventListener ( 'mouseleave' , ( ) => {
4657+ setCamerasBorderNone ( ) ;
4658+ hideVideoMenuBar ( 'ALL' ) ;
4659+ } ) ;
4660+ }
46504661 }
46514662 }
46524663
0 commit comments