HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Options

Problem with embedding YouTube videos in version 2.1

2»

Comments

  • Options
    sudden156sudden156 ✭✭
    edited June 2014

    YouTube definitely embedded properly in my v.2.0 last week with simple pasting in of the URL, no embed code, and I never had this HTML5 preview thing.

  • Options
    hgtonighthgtonight ∞ · New Moderator

    This has two parts:

    1. YouTube embeds change all the time.
    2. Vanilla went to a lazy load model in 2.0, IIRC.

    We can't do anything about the first one. We can do something about the second one. You could pass a click event to all preview images after the page loads. Or do it as the element scrolls into view.

    Honestly, I really like the way it works right how. How often do people post a YouTube embed without giving some context to what the video is?

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • Options

    I find people often post YouTube videos without context, but now I'm encouraging them to change that lazy way. Maybe I will get used to the way it works now.

    How would I pass a click event to preview images after the page loads? That's a good idea, but can that be done in the CSS or is that strictly a javascript job?

  • Options

    @sudden156

    How would I pass a click event to preview images after the page loads?

    If I am correct and assume we diverged from the youtube question.

    jquery fancybox plugin does that for images. you could use that or get ideas from it if you want to do something different.

    you can also use this mod for attachments.

    http://vanillaforums.org/discussion/comment/199810/#Comment_199810

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Options
    hgtonighthgtonight ∞ · New Moderator

    @sudden156 said:
    How would I pass a click event to preview images after the page loads? That's a good idea, but can that be done in the CSS or is that strictly a javascript job?

    You would need to use JS to trigger events. Something like the following might work and is definitely a start:

    jQuery(document).ready(function($) {
      $('.Video.YouTube .VideoPreview').trigger('click');
    });
    

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • Options

    @peregrine‌
    jQuery Fancybox 1.1 doesn't appear to do anything in version 2.1. At least nothing 'automatically' happens in my test, to images or videos.

    @hgtonight‌
    Cheers. If I get anywhere I'll report back, but my long-term bet is on Google probably getting it together to change the way HTML5 video is served to forums.

  • Options

    @sudden156 said:
    peregrine‌
    jQuery Fancybox 1.1 doesn't appear to do anything in version 2.1. At least nothing 'automatically' happens in my test, to images or videos.

    I'll test it later.

    you can also use this for previewing attachments

    http://vanillaforums.org/addon/myattachments-plugin

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Options
    peregrineperegrine MVP
    edited June 2014

    I got fancybox to work with attachments.

    see comments in

    http://vanillaforums.org/discussion/comment/211068/#Comment_211068

    for code changes.

    mouse hover

    mouse click

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

Sign In or Register to comment.