Whenever you insert a Youtube code ( such as ….https://youtu.be/lGjYcU0Y_0Y…)into the relevant box in the post, it plays perfectly well. The problem is at the end of this video, Youtube adds up other related videos on your screen. They do say on. This does not sound professional.
Searching online for a solution to this problem, I was provided with relevant instructions. I was told to
1. go back to Youtube
2. click share—-and then embed
3. The result is this code …..<iframe width=”560″ height=”315″ src=”https://www.youtube-nocookie.com/embed/lGjYcU0Y_0Y” frameborder=”0″ allowfullscreen></iframe> ( This code has been designed for the kind of post where there is not a <iframe…to host the video. In the case of your post, the most appropriate code is ….https://youtu.be/lGjYcU0Y_0Y…) Therefore, using the new code would be problematic as we shall see.
4. After that I am told to click ‘SHOW MORE’
5. By clicking on, I have a series of options
I was basically told that this particular problem arises from the fact that this first statement that reads….Show suggested videos when the video finishes.. has been clicked. If you remove the click, Youtube modifies its code.
6. The new code reads…<iframe width=”560″ height=”315″ src=”https://www.youtube-nocookie.com/embed/lGjYcU0Y_0Y?rel=0″ frameborder=”0″ allowfullscreen></if…
Two major additional elements are introduced in the make up of the first code:
– rel=0 is the culprit cookie. It has been added up to connect the video back to other unrelated videos in Youtube. That is not all.
– the new code has also this bit…nocookie.com/embed/…that is inserted in the final code. As a result, having included the two additional elements, the new code …<iframe width=”560″ height=”315″ src=”https://www.youtube-nocookie.com/embed/lGjYcU0Y_0Y?rel=0″ frameborder=”0″ allowfullscreen></if…could be copied and pasted into the post or the box where the Youtube should be placed.
Unfortunately, your post accept the code formatted in this way…https://youtu.be/lGjYcU0Y_0Y
Therefore, my impression was if I correct the new code, it will be something like this…https://www.youtube-nocookie.com/embed/lGjYcU0Y_0Y?rel=0… Yet, it was rejected by the post. Another option was to remove or replace nocookie.com/embed/ and see what will happen. I have run into the same problem of the video not playing.
WHAT ARE APPROPRIATE SOLUTIONS?
1. I am not good at playing around with your in-built CSS file and other related files. So, I don’t want to make a mess of the whole website.
Can you help me out?
Thanks
Boke
Hi
To remove related videos from youtube you can add rel=0 attribute in theme’s code. Please check this link for more details in this regard, my voleague Bogdan provided a solution here: https://forum.tagdiv.com/topic/stop-youtube-related-videos-in-video-posts/
Let me know how it goes.
Thanks!
I can’t find this…..td_video_support.php…..file
I have tried to check it in this….Stylesheet (style.css) which came with newsmag, but the only place they are talking about a video is this line…
embed
*/
embed {
width: 100%;
}
.videopress-placeholder {
width: 100% !important;
}
.videopress-poster {
height: auto !important;
width: 100% !important;
}
.video-player {
width: 100% !important;
}
…..
Again, there is a line that has mentioned youtube…
It says…..}
.td-icon-youtube:before {
content: ‘\e836’;
}
GOING BY Newsmag: td_config.php (includes/td_config.php)
file, There is a mention of ;featured video. But I couldn’t see the line which I have to edit.
……..
td_global::$td_wp_admin_text_list = array(
// the text for wp-admin -> new post -> featured video box. Usually is the text that tells what post templates support video
‘text_featured_video’ => ‘
<div class=”td-wpa-info”>Paste a link from Vimeo or Youtube, it will be embedded in the post and the thumb used as the featured image of this post. <br/>You need to choose Video Format from above to use Featured Video.</div>
<div class=”td-wpa-info”>Notice: Use only with those post templates:
- Post style default
- Post style 1
- Post style 2
- Post style 3
- Post style 8
</div>’,
// admin panel – header
‘text_header_logo’ => ‘Text logo for header Style 10:’,
IF I HAVE TO DO IT MYSELF, I AM NOT FAMILIAR WITH PLAYING AROUND WITH THOSE CODES. IS THERE ANYONE WHO CAN ASSIST ME? OR WILL YOU GUIDE ME?
You need to look inside the /theme/includes/td_booster/ folder
note in the theme folder all those other folders? Those are the supporting files and modules for the theme.
So, you find the “file” – td_video_support.php – which is an actual file … just like style.css is a “file” ….
then add the code to the file on the line indicated
http://screencast.com/t/CSGcbqLF
-
This reply was modified 9 years by
simchris.
HI
Thanks @Chris for your answer.
@Boke td_video_support.php is not available in wordpress editor, you need to login on the server via ftp, navigate to your-wp-install/wp-content/themes/Newsmag/included/wp-booster to get the file: http://screencast.com/t/EgBxQmYHgzu
Thanks!
Hi, AndreiL,
I have found td_video_support.php file.
As suggested, I have inserted the tiny code this way…
<iframe id=”td_youtube_player” width=”600″ height=”560″ src=”‘ . td_global::$http_or_https . ‘://www.youtube.com/embed/’ . self::get_youtube_id($videoUrl) . ‘?enablejsapi=1&feature=oembed&wmode=opaque&vq=hd720&rel=0’ .
It didn’t work. There is an error
Parse error: syntax error, unexpected ‘=’ in /home/nkoyboke/public_html/blog/wp-content/themes/Newsmag/includes/wp_booster/td_video_support.php on line 22
… I am suspecting the formulation of ….720&rel=0’…. has something missing. Either ‘ should be replaced by “, or 720’&rel=0’. I have tried those combinations, the error is still there.
Can you figure out the problem?
Further complication with td_video_support file……By copying the original file back to the file in the server, another error has cropped in
Parse error: syntax error, unexpected end of file, expecting function (T_FUNCTION) in /home/nkoyboke/public_html/blog/wp-content/themes/Newsmag/includes/wp_booster/td_video_support.php on line 319
I am not quite sure why this time, this error appeared. It seems the original copy was working well whenever I have put it back in the file. But this time round, it came with an error.
Line 319 does not exist.
Andrei,
I have corrected the second problem. The error has been removed.
Parse error: syntax error, unexpected end of file, expecting function (T_FUNCTION) in /home/nkoyboke/public_html/blog/wp-content/themes/Newsmag/includes/wp_booster/td_video_support.php on line 319
…..So I have remained still with the problem regarding this code 720&rel=0’
Boke
Andrei,
The problem is fully solved. I have tried to insert again &rel=0’. This type, I have used letters and sign from your code, rather than typing them from my Mac computer. For some strange reasons, your code editor does not reckonise the sign ‘&’.
Anyhow, for the time being, it is working well.
Thanks a lot for your support.
Boke