음 교체해도 플레이어가 안되네요?
---------------------------------------------------
echo get_file_thumbnail($view_file);
}
echo "</div>\n";
}
?>
<?php //echo get_view_thumbnail($view['content']); ?>
<style>
.youtube_wrap {
position: relative;
padding-bottom: 56.25%; /* 16:9 aspect ratio */
height: 0;
overflow: hidden;
max-width: 100%;
background: #000;
margin-top: 20px;
}
.youtube_wrap iframe {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
</style>
<?php
// Process the content using get_view_thumbnail
$processed_content = get_view_thumbnail($view['content']);
// Further process the output to embed YouTube URLs responsively
$processed_content = preg_replace_callback(
'/(?<!<a href=")https:\/\/(?:www\.)?(?:youtube\.com\/watch\?v=|youtu\.be\/)([a-zA-Z0-9_-]{11})(?!")/',
function($matches) {
$youtube_id = $matches[1];
return '<div class="youtube_wrap">
<iframe src="https://www.youtube.com/embed/' . $youtube_id . '" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</div>';
},
$processed_content
);
echo $processed_content;
?>
</div>
<div id="bo_v_share">
2024-11-06 16:54