Skip to content

Commit

Permalink
Stop iframe from killing Vue in Safari (#3978)
Browse files Browse the repository at this point in the history
  • Loading branch information
arthurperton authored Jul 19, 2021
1 parent 88e1939 commit b52e338
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions resources/js/components/fieldtypes/VideoFieldtype.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

<div class="video-preview-wrapper" v-if="isEmbeddable || isVideo">
<div class="video-preview">
<iframe v-if="isEmbeddable" width="560" height="315" :src="embed" frameborder="0"></iframe>
<iframe v-if="isEmbeddable && canShowIframe" width="560" height="315" :src="embed" frameborder="0" allow="fullscreen"></iframe>
<video controls v-if="isVideo" :src="embed" width="560" height="315"></video>
</div>
</div>
Expand All @@ -31,7 +31,8 @@ export default {
data() {
return {
data: this.value || ''
data: this.value || '',
canShowIframe: false,
}
},
Expand All @@ -47,6 +48,11 @@ export default {
},
mounted() {
// Showing the iframe right away causes Vue to stop in Safari.
this.canShowIframe = true;
},
computed: {
embed() {
if (this.data.includes('youtube')) {
Expand Down

0 comments on commit b52e338

Please sign in to comment.