set src attribute in google vr view for web - php

I want to use Google vrview-web using this example: googlevrview
How can I set src attribute in iframe tag?
Below is the example given in the link:
<iframe width="100%" scrolling="yes" allowfullscreen src="https://storage.googleapis.com/vrview/examples/video/index.html?video=examples/video/congo_2048.mp4&is_stereo=true"></iframe>
Now I have to set my video URL in src like below:
<iframe width="100%" scrolling="yes" allowfullscreen src="<?php echo VIDEO_URL.$data["video"]; ?>&is_stereo=true"></iframe>
It does not display the video.
if I use below iframe tag:
<iframe width="100%" scrolling="yes" allowfullscreen src="https://storage.googleapis.com/vrview/examples/video/index.html?video=MY_VIDEO&is_stereo=true"></iframe>
Still, it prints this data in my page:
Output

Assuming that the VIDEO_URL hold this:
https://storage.googleapis.com/vrview/examples/video/index.html?video=
Your iframe can't just print the HTML. Please inspect your rendered HTML/DOM or iframe src value is proper and not broken.
Moreover it is required that your website, where the videos are, allows CORS. Cross origin resource sharing. Otherwise the Google's script won't load your video inside the iframe in VR mode.

Related

Force any Link From Nested Iframe to Open in New Window

I am displaying some 3rd party banners inside an Iframe which are loading through javascript. Banners are showing inside iframe and links are openning to new window when I browse the url myself. Problem is when I am trying to advertise the url to different ptc sites. Basically this site show url inside iframe. so when my url which is itself an iframe loading inside another iframe, clicking not working. Below is my current code
<base target="_blank"> //in head section
<iframe sandbox="allow-same-origin allow-scripts allow-forms allow-popups allow-downloads" src="<?php echo $_SESSION['ad_url'];?>" frameborder="0" id="pgl" name="pgl" style="overflow:hidden;height:100%;width:100%" height="100%" width="100%" onmouseover="on_mouseover(this)" onmouseout="on_mouseout(this)"></iframe>
As i see the source of the page that embeds my iframe found below code
<iframe sandbox="allow-same-origin allow-scripts allow-forms" id="surfsite" name="surfsite" src="https://sitename.com/sitename.php?" width="100%" height="100%" frameborder="0" scrolling="yes"></iframe>
how can I make this working

Load Server Side in iFrame instead of URL

Is it possible iframe a source file from the server instead of a URL meaning instead of
---> Instead of
<iframe width='100%' height='100%' src='http://example.com/file.php' allowTransparency='yes' frameborder='no' scrolling='no' id='adminheader' > </iframe>
---> Load Server Side File
<iframe width='100%' height='100%' src='/home/username/public_html/header.php' allowTransparency='yes' frameborder='no' scrolling='no' id='adminheader' > </iframe>
The aim to load the header only as is and if possible to access it indirectly applying certain styles and scripts.
No, since iframes are rendered client-side. But I don't see why you couldn't just load them with URL.
<iframe src='http://example.com/header.php'>

How to get the iframe url for specific domain in WordPress

My WordPress WebSite Posts has different type of iframe tags:
eg:
<iframe src="http://examplesite1.tld/somepageordirectory"></iframe>
<iframe src="http://examplesite2.tld/somepageordirectory"></iframe>
<iframe src="http://examplesite3.tld/somepageordirectory"></iframe>
<iframe src="http://examplesite4.tld/somepageordirectory"></iframe>
I Need WordPress Function for get and replace iframe src for specified (eg: examplesite3.tld) domain eg:
<iframe src="http://examplesite1.tld/somepageordirectory"></iframe>
<iframe src="http://examplesite2.tld/somepageordirectory"></iframe>
<iframe src="/embed.php?ref=http://examplesite3.tld/somepageordirectory"></iframe>
<iframe src="http://examplesite4.tld/somepageordirectory"></iframe>
I'm new in WordPress.
Any Help is Highly appreciated and a lot of sorry about my english.
We need the surrounding code to understand how the page is built, not the displayed code.
To do what you're talking about you would use the surrounding html tags and echo the wordpress variable within it, eg:
<iframe src="<?php echo wp_function( 'variable' );?>"></iframe>

Youtube Data API v3 - Disable playlist controls

I'm currently creating this website that has a space for a 200x200 video player only, so I need to reduce the amount of clutter there is on the "video control panel".
This is how the Player looks like right now, I need to remove the |< & >| buttons
Thanks!
Snippet:
<iframe id="ytplayer" type="text/html" width="200" height="200" src="https://www.youtube.com/embed/?listType=playlist&list={PLAYLISTIDHERE}" >
It may depend on your code, but you can try "controls=0", as in:
http://www.youtube.com/embed/$VIDEOID?controls=0
where you replace $VIDEOID with a valid video ID.
Note, that this will also remove the slider to go forward and backward within the video during playing.
To remove also the related videos at the end, after playing, add the parameter "rel=0", as in:
http://www.youtube.com/embed/$VIDEOID?controls=0&rel=0
See for a list of available parameters:
https://developers.google.com/youtube/player_parameters
Try:
<iframe id="ytplayer" type="text/html" width="200" height="200" src="https://www.youtube.com/embed/?controls=0&listType=playlist&list={PLAYLISTIDHERE}" />
Seems the playlist selection does show at left top corner but is not working anymore with controls=0.
An option might be to use autohide=1. I also added modestbranding=1 as suggested.
<iframe id="ytplayer" width="200" height="200" src="https://www.youtube.com/embed/?modestbranding=1&autohide=1&listType=playlist&list={PLAYLISTIDHERE}" />
Is not possible. However you can remove the youtube logo on the playerbar to get some room.
Add the parameter modestbranding=1 to your request
Example http://www.youtube.com/embed/KMoWVujxJgg?modestbranding=1

Dynamically insert sub id into iframe code

How would i take a sub id from a destination url and have it dynamically inserted into an iframe code before the page or iframe is loaded?
I want to add the subid to be able to track conversions from adsense without having a thankyou/goal page since the iframe stays on the same page.
this is the code i have at the end of my destination url
&subid=campaignname_{keyword}
this is the iframe code where i want the subid to dynamically insert before loading
<iframe border="0" frameborder="0" width="680" height="800" src="http://xxxxxxx.com?PublisherSubID=</iframe>
If I understand correctly, you have a page http://xxxxxx.com?subid=12345 and you want to take the subid and drop it into the url of your iframe source.
Try this:
<iframe border="0" frameborder="0" width="680" height="800" src="<iframe border="0" frameborder="0" width="680" height="800" src="http://xxxxxxx.com?PublisherSubID=<?php echo $_GET['subid']; ?>"></iframe>
This will take the subid from the $_GET array of your page and drop it into the source url of your iframe.
This will also include the "campaignname_" text as well. if you want to strip that out, then instead of $_GET['subid'] use str_replace("campaignname_","",$_GET['subid']);

Categories