badwolfff
asked on
How could I rewrite this php code to load my youtube video in an HTML container rather than a flash container like now?
I have a working PHP code that loads a youtube video inside an iframe which contains a flash player unfortunately.
This is not a desirable situation as I don't want to use flash.
How could I change this code to load the video but inside an HTML5 container that works across all devices?
thanks
This is not a desirable situation as I don't want to use flash.
How could I change this code to load the video but inside an HTML5 container that works across all devices?
thanks
<div id="vendor_video" class="cmsms_post_cont col-lg-6 col-sm-6 col-xs-12">
<h1>Video</h1>
<?php $parsed = parse_url($gallery_link); //echo "<pre>"; print_r($parsed['host']); exit; ?>
<?php if($parsed['host'] == 'www.youtube.com') { ?>
<?php $gallery_link = substr($gallery_link, -11); ?>
<?php $link = "https://www.youtube.com/v/"."$gallery_link"; ?>
<div class="cmsms_video_wrap">
<iframe width="522" height="284" src="<?php echo $link; ?>"></iframe>
<!--<iframe width="522" height="284" src="http://www.youtube.com/embed/XGSy3_Czz8k?autoplay=0"></iframe> -->
</div>
<?php } else { ?>
<div class="cmsms_video_wrap">
<iframe width="522" height="284" src="<?php echo $gallery_link; ?>"></iframe>
</div>
<?php } ?>
</div>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I sorted it out myself using video.js
ASKER
I've requested that this question be closed as follows:
Accepted answer: 0 points for badwolfff's comment #a40805507
for the following reason:
I sorted it out myself using video.js
Accepted answer: 0 points for badwolfff's comment #a40805507
for the following reason:
I sorted it out myself using video.js
I sorted it out myself using video.jsVideo.js was suggested in my first post.
https://www.youtube.com/embed/9RY5Z8qwdqs?html5=1
Like this:
<iframe src="https://www.youtube.com/embed/9RY5Z8qwdqs?html5=1"></iframe>
Open in new window