【show.blade.php】
<div class="video-container">
<iframe src="{{ $product->youtube_url }}"
frameborder="0"
allow="accelerometer; autoplay;
encrypted-media; gyroscope;
picture-in-picture"
allowfullscreen></iframe>
</div>
.video-container {
position: relative;
width: 100%;
overflow: hidden;
padding-bottom: 56.25%;
}
.video-container iframe {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
border: none;
}
@import 'youtube';