Facebook Like Problem, Same Count for All Posts - html

Right, I've been at this all day and I still can't fix it.
Website: example.com
I am using the iFrame like api with a link like
<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fexamle.com&layout=button_count&show_faces=false&width=80&action=like&font=arial&colorscheme=light&locale=en_US" scrolling="no" frameborder="0" allowtransparency="true" style="border:none; overflow:hidden; width:80px; height:30px"></iframe>"
or
<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fexamle.com&layout=button_count&show_faces=false&width=80&action=like&font=arial&colorscheme=light&locale=en_US" scrolling="no" frameborder="0" allowtransparency="true" style="border:none; overflow:hidden; width:80px; height:30px"></iframe>
But they seem to have identical vote values, even if you visit the url directly, does anyone know why?
Many thanks,
Even using FB:Like this problem still occurs
<fb:like href="http://examle.com" layout="button_count" show_faces="false" width="80" action="like" font="arial" colorscheme="light" class=" fb_edge_widget_with_comment fb_iframe_widget"></fb:like>
I have added
<meta property="og:title" content="Google Nexus S - Black unlocked"/>
<meta property="og:type" content="product"/>
<meta property="og:url" content="http://examle.com"/>
Yet still it doesn't work? The Lint'er says http://examle.com?
The linter now picks up the correct URL, but the Like buttons still all save the same value...

You are missing some Open Graph Meta tags: og:url and fb:admins or fb:app_id refer to Like Plugin (Open Graph Tags).
If you test both urls in the URL Linter, you'll notice that Facebook is capturing the same URL! (URL1 - URL2)

The problem was, although the meta tags were on the page, they were very far down in the header which was 100 lines+
This meant Facebook wasn't picking them up, moving the meta tags to the first 5 lines of the document fixed the problem. I guess FB only downloads the top X lines/bytes of your website.
Many thanks to ifaour, for pointing me at the URL Linter!
P.s. On top of this FB has cached all the previous likes so I had to change all the links slightly (I just added ?n) for it to recognise it as a new link!

Related

How to fix youtube live chat in HTML

I'm new to code and I want to implement a code that puts the youtube live chat onto the page. Right now it is refusing to connect.
Here is my code:
<html>
<head>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body>
<iframe id="pewdiepie" height="80px" width="300px" frameborder="0" src= "https://akshatmittal.com/youtube-realtime/embed/#!/UCq-Fj5jknLsUf-MWSy4_brA" style="border: 0; width:300px; height:80px; background-color: transparent;"></iframe>
<p>
<iframe id="tseries" height="80px" width="300px" frameborder="0" src="https://akshatmittal.com/youtube-realtime/embed/#!/UC-lHJZR3Gqxm24_Vd_AJ5Yw" style="border: 0; width:300px; height:80px; background-color: transparent;"></iframe>
<p>
<iframe height="500" width="300" src="https://www.youtube.com/live_chat?v=UVxU2HzPGug&embed_domain=<MY_IP>" style="border: 0; width:300px; height:100px; background-color: transparent;"></iframe>
</body>
</html>
Is there anything wrong with the code? And how I can fix it? By the way I hid my IP address.
To embed a youtube live chat, the link must be like this:
"https://www.youtube.com/live_chat?v=<id_video>&embed_domain=<your_domain>"
So, to embed your chat on stackoverflow, it will be:
"https://www.youtube.com/live_chat?v=UVxU2HzPGug&embed_domain=www.stackoverflow.com"
EDIT :
Here is the official documentation from google.
During a live stream, you can embed live chat on your own side by using an iframe.
Get the video ID for the live stream. You can get the video ID from the watch page URL (youtube.com/watch?v=12345). In this case, the video ID is ‘12345’.
If you chose "Stream now," right-click on the player and select Copy video URL to get the video URL.
Get the domain URL for the site you want to embed chat on. If you're embedding chat on www.example.com/youtube_chat, your embedding domain is "www.example.com."
Combine the embedded URL in the following way: https://www.youtube.com/live_chat?v=12345&embed_domain=www.example.com.
This is the URL for your iframe. Note the embed_domain must match the the URL of the page you’re embedding the chat on. If they are different, the embedded chat will not load.

Calling a URL from manifest to HTML file for web browser

I'm looking to take a variable or statement from my manifest (below) and place it in an HTML file. I think it's a reasonably straightforward process but for some reason, I cannot figure out how to get the two to speak with one another. Can I get some help on how to complete this?
Manifest:
applications:
name: application
instance: 1
buildpack: staticfile_buildpack
host: application-hostTenant
memory: x amount
display: browser
**url: https://iframe-tenant.apps.eu1.mindsphere.io**
description: "A simple app using the iframe method to host an outside
application/link. The link/app is specified in the url"
Assume that the iFrame/HTML call is similar (below)
<!DOCTYPE html>
<html>
<head>
<title>Basic Title</title>
</head>
<iframe src="url from the Manifest" style="border:0px #ffffff none;" name="myIFrame" scrolling="yes" frameborder="0" marginheight="0px" marginwidth="0px" height="100%px" width="100%px" allowfullscreen></iframe>
</html>
There doesn't need to be anything else on the web page other than the iframe and access to it.

YouTube embeded video starting at specific time (not working)

I want an embeded video to start at a specific time. In this case at 66 seconds into the video. Hi have tried various versions of the html code below which involves adding ?start=66 or #t=66s to the end of the URL but nothing seems to work. Also tried removing ?ecver=1 but doesn't change it. I also tried adding version=3 to the end of the URL.
I have tried both on Firefox 57.04 and Chrome 63.0.3239.132.
<!DOCTYPE html>
<html>
<head>
<title>test</title>
<meta charset="utf-8">
<head>
<body>
<iframe width="548" height="308" src="https://www.youtube.com/embed/9Y9OXjY_Yhg?start=66?ecver=1" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</body>
</head>
It just won't start the video at the specific time.
https://www.youtube.com/embed/9Y9OXjY_Yhg?start=66?ecver=1
The URL query string starts with a question mark, but multiple name=value pairs are separated from each other using &
Because you messed that up, you effectively send the value 66?ecver=1 for the start parameter - not surprising that gets ignored.
The correct URL to use here is simply https://www.youtube.com/embed/9Y9OXjY_Yhg?start=66&ecver=1 (or even without the &ecver=1, as Jacob H pointed out in comments - if that parameter does not influence another specific setting that you explicitly want to control, that is.)

YouTube iframe embed - full screen

I have a form that is iframed into a web page. Upon completion of the form, a YouTube video is displayed from using iframe embed.
When I enter full screen mode of the YouTube video, nothing really happens.
Is the fullscreen of the nested iframe constrained by the dimensions of the parent iframe?
In the current YouTube iframe (2021), you have to add fullscreen to the allow attribute:
<iframe allow="fullscreen;">
If I understand correctly you have an iframe that contains a second iframe (the youtube one).
Try adding the allowfullscreen attribute to the "parent" iframe.
For full browser support it should look like this:
<iframe src="your_page_url"
allowfullscreen="allowfullscreen"
mozallowfullscreen="mozallowfullscreen"
msallowfullscreen="msallowfullscreen"
oallowfullscreen="oallowfullscreen"
webkitallowfullscreen="webkitallowfullscreen"> </iframe>
React.JS People, remember allowFullScreen and frameBorder="0"
Without camel-case, react strips these tags out!
Adding allowfullscreen="allowfullscreen" and altering the type of YouTube embed fixed my issue.
In HTML5, simply use:
<iframe src="https://www.youtube.com/embed/ID" allowfullscreen />
This attribute can be set to true if the frame is allowed to be placed into full-screen mode by calling it's Element.requestFullscreen() method. If this isn't set, the element can't be placed into full-screen mode. See Mozilla Docs
In React.js framework use property allowFullScreen.
Note that there are more answers pointing to different directions, so hope this post will unite and simplify all mentioned with latest valid approach.
I had to add allowFullScreen attribute to the "parent" iframe. The case of the attribute does matter. I don't think Firefox or Edge/IE11 has a browser specific allowFullScreen attribute. So it looks something like this:
<iframe allowFullScreen='allowFullScreen' src='http://api.youtube.com/...'/>
Putting allowfullscreen inside iframe tag without setting it to true is already deprecated. The updated answer for this issue which is fullscreen is not available with embedded YouTube videos is to set allowfullscreen to true inside tag:
<iframe
id="player"
src="URL here"
allowfullscreen="true">
</iframe>
Tested and working for all browsers without issues.
The best solution and the easiest one to achieve this by using this simple code:
<iframe id="player" src="URL" allowfullscreen></iframe>
Tested and working for all browsers without issues.
Thank you
jut add allowfullscreen="true" to iframe
<iframe src="URL here" allowfullscreen="true"> </iframe>
we can get the code below the video. In the share option, we will have an option embed. If we click on the embed we will get the code snippet for that video.
which will be similar to the below code
<iframe width="560" height="315" src="https://www.youtube.com/embed/GZh_Kj1rS74" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
The above code will help you to get the full-screen option.
I found a solution that worked for me on this page thanks to someone named #orangecoat-ciallella
https://www.drupal.org/node/1807158
The "full screen" button was not working in my Chrome browser on Ubuntu.
I was using the media_youtube module for D6. In the iframe it was using a video URL of the pattern //www.youtube.com/v/videoidhere.
I used the theme preprocessing function to make it output > //www.youtube.com/embed/videoidhere
and it immediately started allowing the fullscreen button to work.
In short, try changing the /v/ to /embed/ in the YouTube URL if you're having a problem.
If adding allowfullscreen does not help, make sure you don't have &fs=0 in your iframe url.
You need to add these two attributes allow="fullscreen;" allowfullscreen to your iframe tag like this:
<iframe ... allow="fullscreen;" allowfullscreen >
</iframe>
Note: for my case, adding just allowfullscreen was not enough to enable fullscreen mode on website.
In my personal blog the youtube videos are embedded with
<div className="flex justify-center">
<iframe width="600" height="350" src="https://www.youtube.com/embed/MoQa_zdmoKs?autoplay=1&mute=1" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture;fullscreen"></iframe>
</div>
easiest way to achieve this in 2021 is:
Go to your desired youtube video, click share and pick embed. Copy and paste the code to your html and you are good to go!
Tested this below code on Edge & Chrome. Expands to full browser view, but not full-screen. I had to stick to this workaround as none of the above solutions worked for my case.
This also immediately auto-plays the video muted though.
<html>
<head>
<body>
<iframe src="https://www.youtube.com/embed/742lIJQVlSg?mute=1&autoplay=1" frameborder="0" marginheight="0" marginwidth="0" width="100%" height="100%" scrolling="auto" allowfullscreen></iframe>
</body>
</head>
</html>
Inserting after the outer-most iframe from inside the nested iframe fixed the issue for me.
var outerFrame = parent.parent.parent.$('.mostOuterFrame');
parent.$('<iframe />', {
src: 'https://www.youtube.com/embed/BPlsqo2bk2M'
}).attr({'allowfullscreen':'allowfullscreen', 'frameborder':'0'
}).addClass('youtubeIframe')
.css({
'width':'675px',
'height':'390px',
'top':'100px',
'left':'280px',
'z-index':'100000',
'position':'absolute'
}).insertAfter(outerFrame);
I managed to find a relatively clean straightforward way to do this. To see it working click on my webpage: http://developersfound.com/yde-portfolio.html and hover over the 'Youtube Demos' link.
Below are two snippets to show how this can be done quite easily:
I achieved this with an iFrame. Assuming this DOM is 'yde-home.html' Which is the source of your iFrame.
<!DOCTYPE html>
<html>
<head>
<title>iFrame Container</title>
<script type="text/javascript" src="js/jquery-2.1.4.min.js"></script>
<style type="text/css">.OBJ-1 { border:none; }</style>
<script>
$(document).ready(function() {
$('#myHiddenButton').trigger('click');
});
</script>
</head>
<body>
<section style="visibility: hidden;">
<button id="myHiddenButton" onclick="$(location).attr('href', '"http://www.youtube.com/embed/wtwOZMXCe-c?version=3&start=0&rel=0&fs=1&wmode=transparent;");">View Full Screen</button>
</section>
<section class="main-area-inner" style="background:transparent;margin-left:auto;margin-right:auto;position:relative;width:1080px;height:720px;">
<iframe src="http://www.youtube.com/embed/wtwOZMXCe-c?version=3&start=0&rel=0&fs=1&wmode=transparent;"
class="OBJ-1" style="position:absolute;left:79px;top:145px;width:1080px;height:720px;">
</iframe>
</section>
</body>
</html>
Assume this is the DOM that loads the iFrame.
<!DOCTYPE html>
<html>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=UTF-8'>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>Full Screen Youtube</title>
<script type="text/javascript" src="js/jquery-2.1.4.min.js"></script>
<script>
$(document).ready(function() {});
</script>
</head>
<body>
<iframe name="iframe-container" id="iframe-container" src="yde-home.html" style="width: 100%; height: 100%;">
<p>Your browser does not support iFrames</p>
</iframe>
</body>
</html>
I've also checked this against the W3c Validator and it validates a HTML5 with no errors.
It is also important to note that: Youtube embed URLs sometimes check to see if the request is coming from a server so it may be necessary to set up your test environment to listen on your external IP. So you may need to set up port forwarding on your router for this solution to work. Once you've set up port forwarding just test from the external IP instead of LocalHost. Remember that some routers need port forwarding from LocalHost/loopback but most use the same IP that you used to log into the router. For example if your router login page is 192.168.0.1, then the port forward would have to use 192.168.0.? where ? could be any unused number (you may need to experiment). From this address you would add the ports that your test environment listen from (normally 80, 81, 8080 or 8088).
Noticed mine worked on chrome. Got it to work in Firefox by going to <about:config> and setting full-screen-api.allow-trusted-requests-only to false.
After full screen worked once, I could set that back to true, and full screen still worked which was quite perplexing.

Facebook Like Button problems

I've attached a Facebook like button to a friends parents home page for there business but the problem is that on when someone likes the link, on the Facebook page it shows a different logo attached to the message on Facebook (a Austrian flag instead of an Australian). The code for the like button is
<div id="fb-root"></div>
<script src="http://connect.facebook.net/en_US/all.js#appId=17923769214223454&xfbml=1">
</script>
<fb:like href="http://www.velumount.com.au/en/" send="false" layout="button_count" width="450" show_faces="true" font="">
</fb:like>
And the website I've placed it on -
http://www.velumount.com.au/en/
You've to set the metatag og:image, i.e. placing in your head something like
<head>
<meta property="og:image" content="http://www.velumount.com.au/config/logo-en.gif" />
</head>
by the way, you can always check how your link will look like with Facebook URL linter