Uploaded image for project: 'Inline Media'
  1. Inline Media
  2. INLINEMEDIA-77

Script to have responsive youtube and dailymotions video do not seems to work

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Major Major
    • 2.8.0
    • 2.4.0
    • 4.5 RC2

      Add a youtube or dailymotions video inside richtext.

      The script for responsive purpose does not work :

      <script type="text/javascript"><script type="text/javascript">         // For responsive purpose (you should set width:100% in CSS)         $j(window).resize(function() {          var iframe = $j('#<xsl:value-of select="$iframeId"/>');           iframe.css('max-height', iframe.attr('height')/iframe.attr('width')*iframe.width());          })        </script> 

      Use the player styles rules that seems to be better :

      <xsl:attribute name="style">width:100%; min-width: 250px; <xsl:if test="$width != ''">max-width:<xsl:value-of select="$width"/>px;</xsl:if><xsl:if test="$height != ''">max-height:<xsl:value-of select="$height"/>px</xsl:if></xsl:attribute> 

      The ratio given by the user should be kept.

            raphael Raphaël Franchet
            llopez Laure Lopez
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: