Skip to:
Content
Pages
Categories
Search
Top
Bottom

oEmbed needs line breaks?

  • Avatar of number_6
    Number_6
    Participant

    @number_6

    Hi folks,

    oEmbed may benefit from having a <br /> tag at the beginning and end of the resulting embed code, or [probably not possible] be put within a <p> tag. I’ve noticed if my users enter text next to their video links and they don’t put the link in a new line it remains a link. This might be useful if a user is simply referring to video link, but 99 times out of 100 they want it to be displayed.

Viewing 11 replies - 1 through 11 (of 11 total)
  • Avatar of Henry
    Henry
    Participant

    @henrywright-1

    I’m not 100% sure on this but isn’t it down to the oEmbed vendor to pass across the HTML markup once a request is made?

    Avatar of number_6
    Number_6
    Participant

    @number_6

    Hi @henrywright-1
    I had no idea that Buddypress relied on any 3rd-party support.

    What I do know is that someone was nice enough on WP forums to write me up a plugin that adds wmode=”opaque” to the resulting Youtube embed codes – so I’d imagine there wouldn’t be much of a problem with BP’s oEmbed files from adding something on both ends of the resulting HTML.

    Avatar of Henry
    Henry
    Participant

    @henrywright-1

    @number_6

    BuddyPress doesn’t rely on 3rd-party support as far as I know. oEmbed support is provided by WordPress.

    Take YouTube for example. If you paste a YouTube video’s link into your blog post, your WordPress blog (the consumer) will make a request to YouTube (the provider). YouTube then responds with an oEmbed response. The HTML therefore gets pulled from the provider’s server.

    That is how I understand the process to work. Hope it helps.

    Avatar of number_6
    Number_6
    Participant

    @number_6

    @henrywright-1

    Yes, but intercepting that embed code before it’s “printed” on the activity stream is possible. I don’t know how to read PHP, but this is how this fellow did it:

    http://pastebin.com/11ppWvL0

    Avatar of valuser
    valuser
    Participant

    @valuser

    see http://codex.wordpress.org/Embeds

    Make sure that the URL is on its own line…..

    Avatar of number_6
    Number_6
    Participant

    @number_6

    @valuser

    Yeah. Great. Never thought of that.

    Avatar of Henry
    Henry
    Participant

    @henrywright-1

    @number_6 just took a look through the plugin you’ve linked to. You’re right, it is modifying the HTML that you’re pulling from YouTube. So what you’re asking can be done easily enough. Have you asked the plugin author to modify the plugin for you?

    Avatar of Henry
    Henry
    Participant

    @henrywright-1

    Anyway, everything aside, have you thought about using CSS to style the HTML you’ve got?

    Avatar of number_6
    Number_6
    Participant

    @number_6

    @henrywright-1 No. But I can. My first concern regarding this thread was to suggest that the BP core be changed to do this anyway – but as my luck would have it (if I understood you), that’s a WP feature and not a BP feature. Which is sad because I’ve been using annoying-ass shortcodes from a plugin to put my Youtubes in my other blogs.

    Thanks for your time and input :)

    Avatar of number_6
    Number_6
    Participant

    @number_6

    @henrywright-1 That’s not a bad idea. That would be the best solution granting that it creates the new line in time for the video to render – but how will I apply CSS to something that doesn’t automatically have a class/ID (still learning my CSS here).

    Avatar of Henry
    Henry
    Participant

    @henrywright-1

    If you right-click on the video in Chrome you can usually find the option to “inspect element”. This will let you see the HTML. The next step is to use CSS to ‘style’ the HTML.

    If you’re just starting out with HTML and CSS, then try taking a look over at w3schools:

    http://www.w3schools.com/html/

    http://www.w3schools.com/css/

    They’ve got some great tutorials. They make most of it look easy :)

Viewing 11 replies - 1 through 11 (of 11 total)

The topic ‘oEmbed needs line breaks?’ is closed to new replies.