Blogger template can't play videos on fullscreen - iframe

I bought this movie library template for Google Blogger, It uses this feature
"Big Screen Player" On every post, you have to need use below iframe player on HTML tab.
<iframe allowfullscreen="" frameborder="0" height="315" id="bigframe" src="https://www.youtube.com/embed/VIDEO-CODE" width="100%"></iframe>
but I can't use the fullscreen mode for youtube videos or google drive videos
what I'm missing?
I've try to contact the seller / developer but theres no anwser...
here it is all of his work:https://www.templatemark.com/search?&max-results=9
all templates this developer is selling have the same problem
here is the demo blogger frontend:
https://demotemplatemovie.blogspot.com/2021/07/test-post-1.html
please if you need access to the edit ask.
thank you very much

Use allow="fullscreen" inside the iframe tag. Or other tags you can use according to this answer are:
allowfullscreen
mozallowfullscreen
msallowfullscreen
oallowfullscreen
webkitallowfullscreen
Sample (You can try it somewhere else as Stack Overflow's compiler is facing issues playing it):
<iframe src="https://www.youtube.com/embed/XGk2EfbD_Ps" title="YouTube video player" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
UPDATE:
Add allowfullscreen in the var c of the jquery, such that:
$(function() {
if ($("#bigframe").length > 0) {
var a = $(".single-post-title").text();
$("#titlevid").text(a);
var b = $("#bigframe").attr("src");
var c = '<iframe src="' + b + '" id="covervideo" frameborder="0" allowfullscreen></iframe>';
$(c).appendTo("#myvideo");
$("#bigframe").remove();
} else $("#myvideo").remove();
});

Related

get data-src content from the iframe of the active slide, then write an src attribute instead with this content

<iframe class="lazyload iframevimeocover" width="100%" top="-50%" left="-50%"
data-src="https://player.vimeo.com/video/https://vimeo.com/337332051&background=1&muted=1&autoplay=0&loop=1&controls=0&autopause=0&byline=0&portrait=0&title=0&transparent=0&gesture=media&dnt=1&quality=1080p" frameborder="0" allow="autoplay; encrypted-media; fullscreen;" webkitallowfullscreen mozallowfullscreen ></iframe>
I use lazysizes to lazyload.
when it is loaded, ".lazyloaded.iframevimeocover" is the iframe class.
On the code below, I get this error in the console:**
TypeError: slideActive.find('.lazyloaded.iframevimeocover').get(0).attr is not a function. (In 'slideActive.find('.lazyloaded.iframevimeocover').get(0).attr('data-src')', 'slideActive.find('.lazyloaded.iframevimeocover').get(0).attr' is undefined)
I didn't find what I need to change to avoid this error ?
actual code:
//// replace data-src to src, and play video from active slide ////
// select active slide
var slideActive = $('.swiper-slide').eq(swiper.activeIndex);
// get content from "data-src" attribute
let dataSrc = slideActive.find('.lazyloaded.iframevimeocover').get(0).attr('data-src');
// write in the iframe a new attribute 'src' with all the dataSrc content inside
slideActive.find('.lazyloaded.iframevimeocover').get(0).attr('src', dataSrc);
// create a new player
var player = new Vimeo.Player(slideActive.find('.lazyloaded.iframevimeocover').get(0));
// play player
player.play();

Ads not showing on YouTube embed iframe

I have used js to include iframe youtube embed
<html>
<body>
<div id="video"></div>
</body>
<script>
// JS
var tag = document.createElement("script");
tag.src = "https://www.youtube.com/iframe_api";
var firstScriptTag = document.getElementsByTagName("script")[0];
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
function onYouTubeIframeAPIReady() {
video = new YT.Player("video", {
height: 360,
width: 640,
videoId: "rfYydagxcJI",
host: "https://www.youtube.com",
playerVars: {
fs: 0,
modestbranding: 1,
playsinline: 1,
rel: 0,
},
});
}
</script>
</html>
I also have tried to add
<iframe width="560" height="315" src="https://www.youtube.com/embed/goSiidPyiYA" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
But both of these aren't showing any ads from YouTube as it should as per YouTube .
If the embeded site isn't trust worthy Google might not show Ads,
The following information is from Google.
Requirements for ads on embedded videos
Ads appear on brand safe sites: YouTube works diligently so that our advertisers' brands appear on sites that reflect our respective core values. Our systems closely evaluate websites and their content against various factors when finding out whether to turn on In-stream ads on YouTube embeds. These factors include a strict set of guidelines on content like adult imagery, violence, inappropriate and hateful language, and sites that promote infringement.
Player details: We require that the video player appear large enough to promote a positive user experience. We recommend a 560x315 pixel or larger player. Also, videos should be embedded using the standard click-to-play embed and not a scripted play.
Source: https://support.google.com/youtube/answer/132596?hl=en

WordPress youtube iframe not working after change content output function in post

I have changed in theme file to display post output like below but now if am going to add any youtube URL in post text it is not showing video iframe. also, I can not use the_content() function because there is some other issue with that function.
//the_content();
$post_content .= $post->post_content;
echo $post_content;
can anyone help me to show the iframe if I add the youtube video URL in the post and display the iframe in the frontend? I know this is default WordPress functionality but it is not working.
any solution will be fine if there is a jQuery function also fine.
So, if I've understood correctly, that you can add content to a post and it shows in front end but that youtube url does not display correctly in an iframe (so it's an oembed problem) then it might make sense to think about adding the whole embed code from YouTube.
Instead of pasting https://youtu.be/TE66McLMMEw into your content area, you might paste in this instead:
<iframe width="560" height="315" src="https://www.youtube.com/embed/TE66McLMMEw" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
There are ways of using JS, grabbing a YouTube url and dynamically generating an iframe for it using the YouTube Player API (as per the video, or full docs and examples here: https://developers.google.com/youtube/iframe_api_reference ) but honestly, it seems a very complex way to solve the problem. It might be better to try and find a more robust fix that lets you use the_content().
UPDATE: if you cannot use iframe directly
We can use notes from youtube API (and a great regex from this answer here: https://stackoverflow.com/a/8260383/8228720) to generate iframe on the fly. You just need to create a div with id "player" and paste the YT url inside it.
HTML
<div id="player">https://youtube-video-link-goes-here</div>
JS
//Get video url from div
let videoUrl = document.getElementById("player").textContent;
let videoId = youtube_parser(videoUrl);
var tag = document.createElement('script');
//Parse url for video id
function youtube_parser(url){
var regExp = /^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#&?]*).*/;
var match = url.match(regExp);
return (match&&match[7].length==11)? match[7] : false;
}
//Dynamically create iframe in the "player" div, adding our video id to it.
tag.src = "https://www.youtube.com/iframe_api";
var firstScriptTag = document.getElementsByTagName('script')[0];
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
var player;
function onYouTubeIframeAPIReady() {
player = new YT.Player('player', {
height: '390',
width: '640',
videoId: videoId,
playerVars: {
'playsinline': 1
},
});
}

YOUKU video, hiding controls & related videos and enable autoplay

I am using youku video in my react site. anyone please help me to hide the controls & related videos. also the autoplay is not working with the code.
code snippet:
{!defaultVideoPlayer && youkoID && (
<iframe
// src={`https://player.youku.com/embed/${youkoID}`}
src={`https://player.youku.com/embed/${youkoID}?rel=0&autoplay=${autoplay}&loop=${loop}&showinfo=0&controls=0&mute=${muted}&playlist=${youkoID}`}
frameBorder="0"
allowFullScreen
title="Yokou video"
/>
)}

Google Video embedded in the Youtube IFrame

I am curious if it is possible to use this api with embedded videos that are only on Google Drive? I am trying the code below and the player is loading, but I am unable to get it to control the the iframe. Is it just not possible?
<div class="view" id="viewer">
<iframe id="player"
type="text/html"
width="640" height="390"
src="https://drive.google.com/file/d/<?= vidId ?>/preview?enablejsapi=1"
frameborder="0"></iframe>
</div>
<script src="https://www.youtube.com/iframe_api"></script>
<script>
var player;
function onYouTubeIframeAPIReady() {
player = new YT.Player('player', {
events: {
'onReady': onPlayerReady
}
});
}
function onPlayerReady(e) {
console.log('player ready');
}
</script>
If it is not possible with the youtube iframe api, is there anyway with javascript to start and stop videos?
Thanks.
It was a way to control the iframe player google drive but it's don't work since august 2016. Google drive embed NO iframe
Video just play without api control.

Resources