Notifications
Clear all

[Solved] youtube-nocookie.com

11 Posts
2 Users
5 Reactions
12.6 K Views
Posts: 66
Customer
Topic starter
(@mickdom)
Member
Joined: 7 years ago

Hi

I'm trying to replace embedded Youtube videos with youtube-nocookie.com and do this:
I replace the code in wpforoembeds.php from line 88 onwards

array ( '# [^ \ s \ r \ n \ t \' \ "<>] * https: // (: www \) youtube \ .com + v = ([^ \ \.?.? s \ r \ n \ t \ 0 <>] +) [^ \ s \ r \ n \ t \ '\ "<>] * # isu', '<div class =" wpf-video "style =" width : '. $ w.'; height: '. $ h.' "> <iframe style =" width: '. $ w.'; height: '. $ h.' "src =" // www.youtube- nocookie.com/embed/$1 "frameborder =" 0 "allowfullscreen> </ iframe> </ div> ',' youtube.com '),
array ( '# [^ \ s \ r \ n \ t \' \ "<>] * https: // (: www \) youtu \ .be \ / ([^ \ s \ r \ n.? \ t \ 0 <>] +) [^ \ s \ r \ n \ t \ '\ "<>] * # isu', '<div class =" wpf-video "style =" width:'. $ w . '; height:'. $ h. '"> <iframe style =" width:'. $ w. '; height:'. $ h. '"src =" // www.youtube-nocookie.com/embed / $ 1 "frameborder =" 0 "allowfullscreen> </ iframe> </ div> ',' youtube.com '),

Is there a better way to do that? Thanks for your help! I'm a beginner:)

10 Replies
Astghik
Posts: 6147
Admin
(@astgh)
Illustrious Member
Joined: 7 years ago

Hi @mickdom,

Please don't do any customization. In the regex, every pattern is very important so don't change anything. Explain more in detail what you need to change, we'll try to help you if it possible.

Reply
Posts: 66
Customer
Topic starter
(@mickdom)
Member
Joined: 7 years ago

Hi Astghik,

thanks for your help! I would like to use the privacy-enhanced mode for embedding Youtube videos.

youtube

Best regards

Reply
Astghik
Posts: 6147
Admin
(@astgh)
Illustrious Member
Joined: 7 years ago

Also, please note that the regex that you left in the previous post can damage your post contents.

Please provide us some information about  youtube-nocookie.com (may be documentation), we'll take it into consideration to add in next version release.

Reply
Posts: 66
Customer
Topic starter
(@mickdom)
Member
Joined: 7 years ago

Hi Astghik, thanks for your information!

That's all I found about youtube-nocookie:

https://support.google.com/youtube/answer/171780?visit_id=1-636620943329167783-4190845816&rd=1 (How this works on Youtube, is shown in the video)

https://productforums.google.com/forum/#!topic/youtube/KVKLo8wfYgg

Youtube will only replace the youtube.com URL with the youtube-nocookie.com URL if you enable privacy-enhanced mode.

Best regards!

Reply
Page 1 / 3
Share:
Scroll to top