Hello,
A couple of days ago, a user named jernate, commented in one my articles if it was possible to automatically add to every embedded video the famous YouTube’s modestbranding feature (read how to add it manually here), a feature that removes the YT logo, so I thought it’d be cool to share this with you all. Tested under Clip-Bucket v2.6.
Make sure you make a backup of the files that are to be modified in case you’d like to revert changes in the future.
1. Open ./plugins/embed_video_mod/embed_video_mod.php
2. Find
return $val;
and before that line, insert
/*******************************/ /*START of modestbranding=1 MOD*/ /*******************************/ //Add ?modestbranding=1 always by default to YouTube Embedded Videos if(stristr($val,'youtube') !== FALSE && stristr($val,'modestbranding=1') === FALSE) { $mb = "?modestbranding=1"; $ytidlength = 11; //Length of YT Video IDs //If code is an iframe if(stristr($val,'<iframe') !== FALSE) { //src="http://www.youtube.com/embed/ (34 chars) $start = strpos($val,'src="http://www.youtube.com/embed/"'); //Position where src starts $val = substr_replace($val, $mb, $start+34+$ytidlength, 0); } //If it is the old YT embed code if(stristr($val,'<embed') !== FALSE || stristr($val,'<object') !== FALSE) { //value="http://www.youtube.com/v/ (32 chars) $start = strpos($val,'value="http://www.youtube.com/v/'); //Position where value starts $val = substr_replace($val, $mb, $start+32+$ytidlength, 0); //src="http://www.youtube.com/v/ (30 chars) $start = strpos($val,'src="http://www.youtube.com/v/'); //Position where src starts $val = substr_replace($val, $mb, $start+30+$ytidlength, 0); } } /*****************************/ /*END of modestbranding=1 MOD*/ /*****************************/
3. Save & Upload
There you go! If for some reason you get stuck at any step, or have any question during the process, please do not hesitate to contact me so I can personally assist you in your specific situation. Comments, upcoming article suggestions, etc, are welcome!
Best Regards,
Richi
Hi Richi, thank you for posting the article. I see this will work for the embed_video_mod. I was hoping this would work for the mass youtube video embedder. That’s what I have. I normally make 50-60 videos at a time and use the mass embedder to post all of the vids I uploaded to youtube. Is that possible?
Thank you
Hello,
It would be definitely possible, however, I don’t have the files and key for that plugin. I’m afraid I won’t be able to assist you with that.
Regards,
Richi
Hi Richi,
I tried but I get error on your line 21. How we can add Modesbranding using Remote Upload? For my it is the easiest way to upload videos from YouTube, Thanks
Hello,
Please try again, there was an error in the code.
Regards,
Richi
Hi Richi,
when I use it I will get error “Parse error: syntax error, unexpected T_VARIABLE in /home/******/embed_video_mod/embed_video_mod.php on line 136” when I want to open my page.
Where can be a problem?
Thanks
Jan
Hi,
The line needs to be
$val = substr_replace($val, $mb, $start+32+$ytidlength, 0);
You are missing a ‘+’ after the 32
Regards.
Hello,
Thank you, Noah. I’ve corrected the article with the change.
Regards,
Richi
Hello,
There was a small error in the code, which has been corrected already. Let me know if there’s anything else I can assist you with.
Regards,
Richi
I found the error at the code:
Line 21
WRONG: $val = substr_replace($val, $mb, $start+32$ytidlength, 0);
CORRECT:$val = substr_replace($val, $mb, $start+32+$ytidlength, 0);
Line 24
WRONG: $val = substr_replace($val, $mb, $start+30$ytidlength, 0);
CORRECT $val = substr_replace($val, $mb, $start+30+$ytidlength, 0);
But it doesnt work for me. I upload new videos and Youtube logo still appearing.
Hello,
Thanks, the article has been corrected.
Regards,
Richi
Thanks for the help.
Hello,
You’re welcome!
Regards,
Richi
Hello, you fail to implement this code. I want to get on sait YouTube videos without their logo be displayed.
Can you help me please
Thank you
Hi,
Please e-mail support@arvixe.com in regards to your issue and include your Arvixe account name.
Regards,
Hello,
The code does work. Are you getting any error? What’s your CB version?
Regards,
Richi
hi Richi
I tryed but i dont understand where i should place he code: before the line return$val, but there are two same lines, so, should I place before the firts time I see the line? also, where does the code starts and ends? does it start at: line 1 or at line 5 on your article? does it end at line 26 o does it end at line 30?