688 posts
  • Has been part of the Envato Community for over 6 years
  • Has referred 1+ members
  • Has sold $5,000+ on Envato Market
  • Has collected 10+ items on Envato Market
+3 more
_rg_ says

ah i didn´t look on other browsers jaja.

I´m on chrome last version. But as i said, was solved putting a background color (not transparent) into the div containing the iframe.

I think is something with the transparent default background used on the iframe->object or something like that. Also could be a combination of factors, including the slider css or similar.

But anyway, what is strange is the point that depending on the background, colors on video links changes…. ¿?¿?

:)

By the way, did you test the embed code i posted? I think it´s better yet. Right now i have a slider with two different sizes for images or videos, and works perfectly, i tested it for vimeo, youtube and dailymotion, and everything ok. Videos at any size and no restriction for aspect radio.

The only thing i don´t like is the iframe….

688 posts
  • Has been part of the Envato Community for over 6 years
  • Has referred 1+ members
  • Has sold $5,000+ on Envato Market
  • Has collected 10+ items on Envato Market
+3 more
_rg_ says

Oh Bebel if you want to know, how i solve the problem when vieweing a video and click on next (if on a slider)?

Ok, it´s supposed to stop the video if you go to some other item on a slider, so, the best i can find, in order to run over any video embebed from any place, is this:

First, i put the video, iframe, object or anything, into a div, let´s call it “holder”.

Then, via jquery, in the moment i trigger the nex or previous, or auto, or anything (depending on slider functions used), i fire a simple html replacement like this:

holder_clone = $('holder').html();
$('holder').html(holder_clone);

That´s it. You can play with some animation in order to fire this delayed a few milliseconds or well… it depends on the slider as i said, but basicly is that, reload the html content, that way, the player will stop for sure.

596 posts Themes and Graphics
  • Has been part of the Envato Community for over 5 years
  • Has referred 50+ members
  • Has sold $250,000+ on Envato Market
  • Has been a beta tester for an Envato feature
+9 more
Bebel says
By the way, did you test the embed code i posted? I think it´s better yet. Right now i have a slider with two different sizes for images or videos, and works perfectly, i tested it for vimeo, youtube and dailymotion, and everything ok. Videos at any size and no restriction for aspect radio.

I already had something similar – within our framework a bit more complex, so I just posted the quick and easy solution that everybody can use! I am glad you found out about the height, too :D

I haven’t used it in a slider for now. Thank you for pointing this out, I think this could be useful.

However, I wish more people would share their solutions, after they find it :) Even if you have lots of experience coding, wordpress is just another world. All the nice concepts you leant before.. MVC , Best Coding Practices, ... just don’t apply on wordpress :P I am so looking forward to the official php5 introduction :)

And yes, the iframes are not nice, but seems thats the way oEmbed handles it. Like this, they don’t have to worry about any changes in the source code of the video site.

9 posts
  • Has been part of the Envato Community for over 5 years
  • Has collected 50+ items on Envato Market
  • Sells items exclusively on Envato Market
  • Located in Netherlands
mikebektas says

Did you try this!

/* Set Embed Size  */
function embed_defaults($embed_size){
    if( is_single() || is_home() ){ // If displaying a single post or home
        $embed_size['width'] = 400; // Adjust values to your needs
        $embed_size['height'] = 500;
    }

    return $embed_size; // Return new size
}

add_filter('embed_defaults', 'embed_defaults');

Helpful Information

  • Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
  • Open a support ticket if you would like specific help with your account, deposits or purchases.
  • Item Support by authors is optional and may vary. Please see the Support tab on each item page.

Most of all, enjoy your time here. Thank you for being a valued Envato community member.

Post Reply

Format your entry with some basic HTML. Read the Full Details, or here is a refresher:

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody

:grin: :shocked: :cry: Complete List of Smiley Codes

by
by
by
by
by
by