|
313 | 313 | this.element.style.border = '5px solid ' + this.backgroundColor; |
314 | 314 | this.iframe = document.createElement('iframe'); |
315 | 315 | this.iframe.setAttribute('referrerpolicy', 'strict-origin-when-cross-origin'); |
| 316 | + this.iframe.setAttribute('allowfullscreen', 'true'); |
316 | 317 | if (this.iframeSrc !== null) { |
317 | 318 | this.iframe.src = this.iframeSrc; |
318 | 319 | } else if (this.iframeHtml !== null) { |
|
3090 | 3091 | interaction: true, |
3091 | 3092 | backgroundColor: '#444444', |
3092 | 3093 | innerHTML: ` |
3093 | | - <div id="videoControls_onOffButton" title="Watch a YouTube video.\n\nWhen switching on, the video will not play automatically, you need to press play.\nAfter pressing play, click outside the video to regain keyboard movement control." style="position: absolute; left: 35px; top: 35px; width: 80px; height: 80px; border: 5px solid #FFDF00; border-radius: 60px; background-color: transparent; box-shadow: 0 0 15px #FFDF00;"> |
| 3094 | + <div id="videoControls_onOffButton" title="Watch a YouTube video.\n\nIf you see an 'Error 153' message when switching on, then switch off and on to try again." style="position: absolute; left: 35px; top: 35px; width: 80px; height: 80px; border: 5px solid #FFDF00; border-radius: 60px; background-color: transparent; box-shadow: 0 0 15px #FFDF00;"> |
3094 | 3095 | <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" style="position: absolute; left: 15px; top: 15px; width: 50px; height: 50px;" fill="#ffffff" stroke="none"> |
3095 | 3096 | <path d="M16.56,5.44L15.11,6.89C16.84,7.94 18,9.83 18,12A6,6 0 0,1 12,18A6,6 0 0,1 6,12C6,9.83 7.16,7.94 8.88,6.88L7.44,5.44C5.36,6.88 4,9.28 4,12A8,8 0 0,0 12,20A8,8 0 0,0 20,12C20,9.28 18.64,6.88 16.56,5.44M13,3H11V13H13"></path> |
3096 | 3097 | </svg> |
|
3101 | 3102 | const fire = html3d.panels.find((so) => so.id === 'fire'); |
3102 | 3103 | const onOffButton = document.getElementById('videoControls_onOffButton'); |
3103 | 3104 | if (video.userData.isOn === false) { |
3104 | | - video.iframe.src = 'https://www.youtube.com/embed/BiQXFKYa-co?autoplay=0&mute=0&controls=1&loop=0'; |
| 3105 | + video.userData.isOn = true; |
| 3106 | + video.iframe.setAttribute('allow', 'autoplay;'); |
| 3107 | + video.iframe.src = 'https://www.youtube-nocookie.com/embed/BiQXFKYa-co?autoplay=1&mute=0&controls=1&loop=0'; |
3105 | 3108 | video.element.style.pointerEvents = 'auto'; |
3106 | 3109 | video.element.style.userSelect = 'auto'; |
3107 | | - video.userData.isOn = true; |
3108 | 3110 | onOffButton.style.border = '5px solid #55F755'; |
3109 | 3111 | onOffButton.style.boxShadow = '0 0 15px #00F700'; |
3110 | 3112 | onOffButton.style.textShadow = '0 0 8px #55F755'; |
3111 | 3113 | fire.element.style.visibility = 'hidden'; |
3112 | 3114 | fire.localData.visible = false; |
3113 | 3115 | } else { |
| 3116 | + video.userData.isOn = false; |
| 3117 | + video.iframe.setAttribute('allow', ''); |
3114 | 3118 | video.iframe.src = ''; |
3115 | 3119 | video.element.style.pointerEvents = 'none'; |
3116 | 3120 | video.element.style.userSelect = 'none'; |
3117 | | - video.userData.isOn = false; |
3118 | 3121 | onOffButton.style.border = '5px solid #FFDF00'; |
3119 | 3122 | onOffButton.style.boxShadow = '0 0 15px #F77C00'; |
3120 | 3123 | onOffButton.style.textShadow = '0 0 8px #F77C00'; |
|
0 commit comments