• Home
  • Categories
  • Recent
  • Popular
  • Top
  • Tags
  • Users
  • Groups
  • Documentation
    • Home
    • Read API
    • Write API
    • Plugin Development
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
v3.5.2 Latest
Buy Hosting

[nodebb-plugin-ns-embed] NS Embed

Scheduled Pinned Locked Moved NodeBB Plugins
ns-pluginembedyoutubevimeo
136 Posts 36 Posters 33.6k Views
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • NicolasN Offline
    NicolasN Offline
    Nicolas Plugin & Theme Dev
    wrote on last edited by Nicolas
    #1

    NodeBB: Embed

    Embed media and rich content in posts: youtube, vimeo, twitch etc. It's a dynamic plugin, it means, you can add your own embed code, you don't need to write separate plugin for it. By default, plugin is shipped with several predefined embeds, you can tune them, remove them or add new ones:

    • Youtube
    • Vimeo
    • Coub
    • Vine

    To install predefined embeds, use utility in ACP.

    Don't forget to share your good ideas for embeds with others. Most popular will be included in predefined set.

    Links

    • Plugin
    • ACP Look

    Preview

    1 Reply Last reply
    7
  • NicolasN Offline
    NicolasN Offline
    Nicolas Plugin & Theme Dev
    wrote on last edited by
    #2

    Version 1.1.0

    • skip invalid regular expressions
    • updated default youtube rule (to handle www 😉 )
    1 Reply Last reply
    1
  • LLLRHL Offline
    LLLRHL Offline
    LLLRH
    wrote on last edited by
    #3

    quite impressive work!

    1 Reply Last reply
    0
  • codejetC Offline
    codejetC Offline
    codejet GNU/Linux
    wrote on last edited by codejet
    #4

    @Nicolas did you get twitter working in this ?
    code to implement

    Watch
    (?:https?://)?(?:twitter.com)/([^/"\s])/statuse?s?/([^/"\s])(/photo/\d|)
    Replace
    <blockquote class="content twitter-tweet" lang="en"><a href="https://twitter.com/$1/status/$2"></a></blockquote><script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>

    I have everything working except it keeps adding text around the embed:

    " target="_blank" rel="nofollow">

    [this is where tweet embeds perfectly]

    /a>

    this something to do with externel links in nodebb, is it doing it automatically internally or something? is there a way to remove it

    love your work btw, keep it up

    1 Reply Last reply
    0
  • NicolasN Offline
    NicolasN Offline
    Nicolas Plugin & Theme Dev
    wrote on last edited by
    #5

    I didn't try to do it with Twitter. But, basically, you can embed nearly everything.
    Double check plugin description, there are some conflicts with another plugins. Maybe you didn't do something 😉

    codejetC 1 Reply Last reply
    0
  • codejetC Offline
    codejetC Offline
    codejet GNU/Linux
    replied to Nicolas on last edited by
    #6

    @Nicolas will try reorder plugins, nope same issue

    I have a feeling it's the externel link adder/checker, cos I've checked out the code, it's not the markdown / blockquote

    must be the way it is checking <a href="s"></a> if you notice the way twitter embeds it's content. It's not the standard iframe embed

    NicolasN 1 Reply Last reply
    0
  • NicolasN Offline
    NicolasN Offline
    Nicolas Plugin & Theme Dev
    wrote on last edited by
    #7

    @codejet

    Also try to change only for blockquotes:

    <blockquote class="content twitter-tweet" lang="en"><a href="https://twitter.com/$1/status/$2"></a></blockquote>
    

    And Javascript inject only one time

    <script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>
    

    It doesn't good, that you inject Javascript to the page after every replaced twitter url.

    1 Reply Last reply
    0
  • NicolasN Offline
    NicolasN Offline
    Nicolas Plugin & Theme Dev
    replied to codejet on last edited by
    #8

    @codejet you have to disable auto-linking in Markdown plugin.

    codejetC 1 Reply Last reply
    0
  • codejetC Offline
    codejetC Offline
    codejet GNU/Linux
    wrote on last edited by
    #9

    will try add the javascript to the custom header in nodebb panel. last time I tried this I'm sure it didn't work well

    1 Reply Last reply
    0
  • codejetC Offline
    codejetC Offline
    codejet GNU/Linux
    replied to Nicolas on last edited by codejet
    #10

    @Nicolas tried numerous things in the markdown config, but the option to work would look to be

    Open external links in a new tab/window
    Tell web crawlers that external links are not to be followed

    EDIT: Disabling both of these reduces it to

    ">
    [embed works]
    /a>

    th@ would seem to be the one doing you would think, but has no effect

    also the twitter likes to have the javascript only after the blockquote. doesn't work in the custom header. doh, would you be able to strip it from adding it to content (between the <p></p>'s in ur plugin ?

    1 Reply Last reply
    0
  • NicolasN Offline
    NicolasN Offline
    Nicolas Plugin & Theme Dev
    wrote on last edited by
    #11

    If it likes after, place it in the end of the page:

    <script ...
    </body>
    
    codejetC 1 Reply Last reply
    0
  • codejetC Offline
    codejetC Offline
    codejet GNU/Linux
    replied to Nicolas on last edited by codejet
    #12

    @Nicolas said:

    If it likes after, place it in the end of the page:

    <script ...
    </body>
    

    <script>
    require(['forum/footer']);
    </script>
    <script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>
    </body>
    </html>

    unbelievably that updates all of the tweet embeds now without putting it in the embed replace code

    but still the same issues with it putting html in the post as content between the <p></p>'s
    post looks like:

    ">
    [embed]
    /a>

    not sure what's happenning

    1 Reply Last reply
    0
  • codejetC Offline
    codejetC Offline
    codejet GNU/Linux
    wrote on last edited by codejet
    #13

    ok, well placing the javascript @ the end before </body> has bad effect because the post doesn't update after hitting [Submit] button. Basically updates after you push a page reload. So my conclusion is that the javascript code is fine added to the replace code , it seems to work perfectly.

    There is still the same issue with it adding html as content around the embed, somehow it does this and I don't remember actually that it had this problem around nodebb version 0.6.0/0.7.0 ...

    So I'll just leave you with this pic to show progress:
    0_1450846824849_embed.jpg

    1 Reply Last reply
    0
  • NicolasN Offline
    NicolasN Offline
    Nicolas Plugin & Theme Dev
    wrote on last edited by Nicolas
    #14

    Version 2.0.0 Final

    New version is available. Summary: important one, plugin doesn't create any restrictions anymore. Auto-linking restriction is removed. Even more interesting fact - you can use plugin with Markdown plugin or without. It means, plugin should work in most cases.

    • Important: compatibility with Markdown plugin
    • Compatibility with content plugins
    • Best practice for ACP scripts
    • Update all dependencies

    P.S.
    "Final" means - my TODO list is empty for this plugin. I will do patches if needed, for now, I will concentrate on another plugins.

    1 Reply Last reply
    1
  • NicolasN Offline
    NicolasN Offline
    Nicolas Plugin & Theme Dev
    wrote on last edited by Nicolas
    #15

    Version 2.0.1

    New version is available. Improved parsing of Youtube Urls, now it ignores links to Youtube profiles.
    Don't forget to delete your current Youtube rule and install a new one (just click on Install Default Rules - It will install only missing rules, it will not override any rules which are currently in use)

    1 Reply Last reply
    0
  • TzA-0x000000001T Offline
    TzA-0x000000001T Offline
    TzA-0x000000001
    wrote on last edited by
    #16

    Hi.

    I'm currently using your plugin and it really works like a charm in order to extend the Markdown syntax, thank you.
    However, I have a little issue with my code section. Can your plugin ignore <pre> and <code> tags ?

    Thank you for getting your attention.

    1 Reply Last reply
    0
  • NicolasN Offline
    NicolasN Offline
    Nicolas Plugin & Theme Dev
    wrote on last edited by
    #17

    Core functionality of the plugin is Regular Expressions. If you need to ignore some particular tag, or something, you can handle it via your regular expression.

    1 Reply Last reply
    0
  • NicolasN Offline
    NicolasN Offline
    Nicolas Plugin & Theme Dev
    wrote on last edited by
    #18

    Version 2.1.0

    A new version is available. Twitch rules are unlocked.

    Changelog:

    • Add Twitch Default rule for Live content
    • Add Twitch Default rule for VoD
    1 Reply Last reply
    0
  • NicolasN Offline
    NicolasN Offline
    Nicolas Plugin & Theme Dev
    wrote on last edited by
    #19

    Here is an example how Live embed for Twitch with disabled auto-play:

    2.1.0 Twitch Live Preview

    1 Reply Last reply
    0
  • CJ InfantinoC Offline
    CJ InfantinoC Offline
    CJ Infantino
    wrote on last edited by
    #20

    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?

    1 Reply Last reply
    0

Copyright © 2023 NodeBB | Contributors
  • Login

  • Don't have an account? Register

  • Login or register to search.
Powered by NodeBB Contributors
  • First post
    Last post
0
  • Home
  • Categories
  • Recent
  • Popular
  • Top
  • Tags
  • Users
  • Groups
  • Documentation
    • Home
    • Read API
    • Write API
    • Plugin Development