Search

In my experience everything works as expected except for only a few hours, after a while it seems to “forget” about the correct url.

Has it something to do with the cache update? If I leave the field blank nothing works, if I put some value it works, but not regularly

@iltrico I’ll fix that bug today. Thanks for reporting.

Thank you rainerborene, I’m glad I can still use an otherwise great extension!

Hi rainerborene, have you got the chance to fix that bug?

Hi, I’m sorry to write here again. I tried to reinstall the extension, with or without a number in the update cache but after a while I still can’t get the video ID, everything else appears correct in the xml.

Does someone knows where should I look to fix it? I don’t really know php and some help would be really appreciated

Thanks a lot

YouTube Videos updated to version 0.2 on 8th of March 2010

Tryed on a fresh symphony install, still doesn’t work. Worst, it loses the video’s url when you save an entry.

How could I help you solve the issue? What data do you need?

What URL are you using?

something like

http://www.youtube.com/watch?v=jlDmFnskJrs

rainerborene, I’ve just fixed this issue as I came across it an older version of this extension.

In the updateVideoInfo function, the variable is incorrectly referenced as $clip_id instead of $video_id so when the cache goes to update, Youtube will return a nonsense video.

I am having difficulties with this extension. No matter what video I add to the field (e.g., http://www.youtube.com/watch?v=kdi-EkCoUCk), the XML output points to some nonsensical video:

alt text link to photo

But the video loads correctly within the content section:

alt text link to photo

Any ideas why this type of error would be occurring? I have never personally even viewed the video my XML is outputting - possibly my girlfriend has.

Also, could someone post an example XSLT template to post the video on the front end? Is it possible to use some parameters to resize the video?

Big thanks! Adam

Adam, what version of the extension are you running?

Hey man - Version: 0.2

If you setup a basic text field (let’s call it video-url), you can build a basic Named Template like so…

<xsl:template name="youtube-media">
    <xsl:param name="element"/>
    <xsl:param name="width"/>
    <xsl:param name="height"/>
    <xsl:param name="video-id">
        <xsl:if test="contains($element,'youtube.com')">
            <xsl:choose>
                <xsl:when test="contains($element,'youtube.com/watch?v=')">
                    <xsl:value-of select="substring-after($element,'youtube.com/watch?v=')"/>
                </xsl:when>
                <xsl:when test="contains($element,'youtube.com/v/')">
                    <xsl:value-of select="substring-after($element,'youtube.com/v/')"/>
                </xsl:when>
            </xsl:choose>
        </xsl:if>
    </xsl:param>
    <xsl:param name="url">
        <xsl:choose>
            <xsl:when test="contains($element,'youtube.com')">
                <xsl:value-of select="concat('http://www.youtube.com/v/',$video-id,'&amp;hl=en_US&amp;fs=1&amp;rel=0')"/>
            </xsl:when>

        </xsl:choose>

    </xsl:param>

    <object width="{$width}" height="{$height}" class="video-embed">
        <param name="allowFullScreen" value="true"></param>
        <param name="allowScriptAccess" value="always"></param>
        <param name="movie" value="{$url}"></param>
        <embed src="{$url}" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="{$width}" height="{$height}"></embed>
    </object>
</xsl:template>

Then call the template like so…

<xsl:call-template name="youtube-media">
      <xsl:with-param name="width" select="640"/>
       <xsl:with-param name="height" select="348"/>
       <xsl:with-param name="element" select="video-url"/>
</xsl:call-template>

Hey Brian - thanks so much for hitting me up. I spent some time trying to break that script down and I think I am finally understanding what it’s accomplishing! It cool seeing these new functions (e.g., contains, substring-after, and concat) being used. Thanks again man.

@bzerangue Nice template. You could publish it as an utility here.

Worked like a charm!!

YouTube Videos updated to version 0.3 on 8th of June 2010

@rainerborene - I made a utility template that will work with a basic text field and a URL to Vimeo or YouTube like shown above.

looks great, have you implemented the html5 method already?

http://www.youtube.com/html5

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details