How I will get meta information specified by EmbedURL? I have tried get_meta_tags('raw_html')
. But it returns nothing.
MY HTML:
<!--Video 1-->
<div class="embed-responsive-item" itemprop="video" itemscope="" itemtype="http://schema.org/VideoObject">
<video class="embed-responsive-item" controls="" loop="">
<source src="INTERNAL_VIDEO_URL">
</video>
<meta itemprop="name" content="">
<meta itemprop="duration" content="">
<meta itemprop="thumbnailUrl" content="THUMBNAIL_URL">
<meta itemprop="embedURL" content="INTERNAL_VIDEO_URL">
<meta itemprop="uploadDate" content="2021-03-27T04:10:1600Z">
</div>
<!--Video 2-->
<div class="embed-responsive embed-responsive-16by9" onclick="loadYoutubeVideoThroughYTApi(this)" data-src-id="player-1" data-yut-var="YOUTUBE_VIDEO_ID">
<meta itemprop="description" content="META_DESCRIPTION_2">
<meta itemprop="duration" content="PT1M13S">
<meta itemprop="name" content="META_TITLE_2">
<meta itemprop="thumbnailUrl" content="https://i.ytimg.com/vi/YOUTUBE_VIDEO_ID/maxresdefault.jpg">
<meta itemprop="embedURL" content="https://www.youtube.com/embed/YOUTUBE_VIDEO_ID">
<meta itemprop="uploadDate" content="2019-02-04T11:00:43.000Z">
</div>
<!--Video 3-->
<div class="embed-responsive-item" itemprop="video" itemscope="" itemtype="http://schema.org/VideoObject">
<video class="embed-responsive-item" controls="" loop="">
<source src="INTERNAL_VIDEO_URL_2">
</video>
<meta itemprop="name" content="">
<meta itemprop="duration" content="">
<meta itemprop="thumbnailUrl" content="THUMBNAIL_URL_2">
<meta itemprop="embedURL" content="INTERNAL_VIDEO_URL_2">
<meta itemprop="uploadDate" content="2021-03-27T04:10:1600Z">
</div>
As you can see the html contains three different videos with three different meta properties. So the result array should be look like this
Desired Output:
Array
(
[0] => Array
(
[url] => INTERNAL_VIDEO_URL
[meta_name] => NULL
[meta_description] => NULL // as you can see no meta tags for description
[meta_duration] => NULL
[meta_thumbnail] => THUMBNAIL_IMAGE_URL
[upload_date] => 2021-03-27T04:10:1600Z
)
[1] => Array
(
[url] => https://www.youtube.com/embed/YOUTUBE_VIDEO_ID
[meta_name] => META_TITLE_2
[meta_description] => META_DESCRIPTION_2
[meta_duration] => PT1M13S
[meta_thumbnail] => https://i.ytimg.com/vi/YOUTUBE_VIDEO_ID/maxresdefault.jpg
[upload_date] => 2021-03-27T04:10:1600Z
)
[2] => Array
(
[url] => INTERNAL_VIDEO_URL_2
[meta_name] => NULL
[meta_description] => NULL // as you can see no meta tags for description
[meta_duration] => NULL
[meta_thumbnail] => THUMBNAIL_IMAGE_URL_2
[upload_date] => 2021-03-27T04:10:1600Z
)
)
How will I get the set of array like this?