[nodebb-plugin-ns-embed] NS Embed
-
Is there any examples of how of the 'watch' and "replace" for embedded videos? I am trying to get uploaded videos embedded but I can't seem to get the proper regex or new replacement code to get it to work.
Do you regex on the markdown code, or the url? What is the replacement code?
-
For anyone who was having the same issues as me, I found my answer here:
https://github.com/NicolasSiver/nodebb-plugin-ns-embed/issues/7 -
Hi code for dailymotion vidéo
(?:<a.*?)?(?:https?:\/\/)?(?:www\.)?dailymotion\.com\/video\/([a-zA-Z0-9_-]{4,7})(?:.*?\/a>)?
<div class='embed-wrapper'><div class='embed-container'><iframe src="//www.dailymotion.com/embed/video/$1" frameborder="0" allowfullscreen></iframe></div></div>
-
For framatube vidéo
(?:<a.*?)?(?:https?:\/\/)?(?:www\.)?framatube\.org\/videos\/watch\/([a-zA-Z0-9_-]{4,36})(?:.*?\/a>)?
<div class='embed-wrapper'><div class='embed-container'><iframe src="//framatube.org/videos/embed/$1" frameborder="0" allowfullscreen></iframe></div></div>
-
For Facebook vidéo
(?:<a.*?)?(?:https?:\/\/)?(?:www\.)?facebook\.com\/([a-zA-Z0-9_-]{4,88})\/videos\/([a-zA-Z0-9_-]{4,20})(?:.*?\/a>)?
<div class='embed-wrapper'><div class='embed-container'><iframe src="https://www.facebook.com/plugins/video.php?href=https://www.facebook.com/$1/videos/$2/" frameborder="0" allowFullScreen></iframe></div></div>
-
For Instagram vidéo
(?:<a.*?)?(?:https?:\/\/)?(?:www\.)?instagram\.com\/p\/([a-zA-Z0-9_-]{4,20})(?:.*?\/a>)?
<blockquote class="instagram-media" data-instgrm-captioned data-instgrm-permalink="https://www.instagram.com/p/$1/?utm_source=ig_embed" data-instgrm-version="9"></blockquote> <script async defer src="//www.instagram.com/embed.js"></script>
-
Hello,
For my part it worked there is still a few but since today it no longer works for Facebook?
thank you in advance
MAJ : I finally realize that it still works but that with some video of Facebook not all
@The-Worms said in [nodebb-plugin-ns-embed] NS Embed:
<div class='embed-wrapper'><div class='embed-container'><iframe src="https://www.facebook.com/plugins/video.php?href=https://www.facebook.com/$1/videos/$2/" frameborder="0" allowFullScreen></iframe></div></div>
-
v3.0.0
New version is available.
- Changed compability with NodeBB v1.11.0
-
For SoundCloud
(?:<a.*?)?(?:https?:\/\/)?(?:www\.)?soundcloud\.com\/([a-zA-Z0-9_^/-]{4,250})(?:.*?\/a>)?
<div class='embed-wrapper'><div class='embed-container'> <iframe scrolling='no' frameborder='no' allow='autoplay' src='https://w.soundcloud.com/player/?url=https://soundcloud.com/$1&color=%23ff5500&auto_play=false&hide_related=false&show_comments=true&show_user=true&show_reposts=false&show_teaser=true&visual=true'></iframe> </div></div>
-
For MixCloud
(?:<a.*?)?(?:https?:\/\/)?(?:www\.)?mixcloud\.com\/([a-zA-Z0-9_-]{4,36})\/([a-zA-Z0-9_-]{4,136})(?:.*?\/a>)?
<div class='embed-wrapper'><div class='embed-container'> <iframe src='https://www.mixcloud.com/widget/iframe/?light=1&hide_artwork=1&feed=%2F$1%2F$2%2F' frameborder='0' ></iframe> </div></div>
-
For Spotify album
(?:<a.*?)?(?:https?:\/\/)?(?:www\.)?open\.spotify\.com\/album\/([a-zA-Z0-9_-]{4,36})(?:.*?\/a>)?
<div class='embed-wrapper'><div class='embed-container'> <iframe src='https://open.spotify.com/embed/album/$1' frameborder='0' allowtransparency='true' allow='encrypted-media'></iframe> </div></div>
-
For .MP4 direct upload (for those who allow video hosting)
<a href="/assets/uploads/files/(.*).mp4">[^<]*</a>
<video id="$1" src="/uploads/files/$1.mp4" controls style="width:800px"> </video> <div><small><a href="/uploads/files/$1.mp4" target="_blank">Download video</a></small></div>
Credit to @I0co
-
@nicolas - I have tried setting up a custom embed for Twitter per GitHub resource ref: community rules.
nodebb-plugin-ns-embed/docs/community-rules.md at master · NicolasSiver/nodebb-plugin-ns-embed
Embed media and rich content in posts: YouTube, Vimeo, Twitch and more. - nodebb-plugin-ns-embed/docs/community-rules.md at master · NicolasSiver/nodebb-plugin-ns-embed
GitHub (github.com)
Yet it does not seem to work.
The Plugin itself works, for example YouTube embeds work perfectly and even the custom instagram rule also!
Any ideas or suggestions appreciated in advance. Thanks.
- running nBB 1.11.2
- npm 6.4.1
-
For twitter :
watch :
(?:<a.*?)?(?:https?:\/\/)?(?:twitter\.com)\/([^\/\"\s]*)\/status\/([^\/\"\s]*)(\/photo\/\d|)(?:.*?\/a>)?
replace :
<div class='embed-wrapper'> <blockquote class="twitter-tweet"><a href="https://twitter.com/$1/status/$2?ref_src=twsrc%5Etfw"></a></blockquote> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script> </div>
-
@The-Worms said in [nodebb-plugin-ns-embed] NS Embed:
For twitter :
watch :
(?:<a.*?)?(?:https?:\/\/)?(?:twitter\.com)\/([^\/\"\s]*)\/status\/([^\/\"\s]*)(\/photo\/\d|)(?:.*?\/a>)?
replace :
<div class='embed-wrapper'> <blockquote class="twitter-tweet"><a href="https://twitter.com/$1/status/$2?ref_src=twsrc%5Etfw"></a></blockquote> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script> </div>
@The-Worms Ok thanks for that but strangely I went to try this with the plugin and now its not working anymore. I had fresh nodeBB install and now it's hanging when selected in admin. I tried another nodeBB installation and same problem. Hmmm...