1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Fixed Metacafe BB Code Media Site does not match all Metacafe videos

Discussion in 'Resolved Bug Reports' started by Chris D, Jan 4, 2014.

  1. Chris D

    Chris D XenForo Developer Staff Member

    Example:
    http://www.metacafe.com/watch/11151921
    http://www.metacafe.com/watch/11151921

    Fix here is adding a trailing slash:
    http://www.metacafe.com/watch/11151921/


    Example 2:
    http://www.metacafe.com/watch/an-pX6S2u2n2hbbJt/cat_in_the_hat_2003_the_house_transformed_from_opening_the_crate/
    http://www.metacafe.com/watch/an-pX...the_house_transformed_from_opening_the_crate/

    Fix required here is a change in the regex. The XenForo expression assumes the ID will be digits only, whereas it seems this is not the case.
     
    Adam Howard likes this.
  2. EQnoble

    EQnoble Well-Known Member

    The second link wouldn't work (embed) anyways because the embed option is actually disabled at the site, if you click on embed below the video you will see it is muted out...you can clip and embed with the js functions they have in that player container but they appear to clip and link to a different site...on that note however I just tried this out and it seems to work for parsing those vid links...

    Code:
    #metacafe\.com/watch/(?P<id>[a-z0-9-]+)(/[a-z0-9_-]+)?#siu
     
    Adam Howard and Chris D like this.
  3. Mike

    Mike XenForo Developer Staff Member

    So it looks like integers are for their own videos and strings are links to other video sites. For example, it actually links to YouTube if the ID starts with "yt-". YT videos are embeddable, though as it stands others don't seem to be.

    The regex I'm using is:
    Code:
    #metacafe\.com/watch/(?P<id>[a-z0-9-]+)(/|$)#siU
    The embed code needs to be changed support the "re-embed" videos as well:
    Code:
    <iframe src="http://www.metacafe.com/embed/{$id}/" width="500" height="300" allowFullScreen frameborder=0></iframe>
    I'm making these changes for 1.3.
     
    EQnoble and Chris D like this.

Share This Page