vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.8 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=235)
-   -   Major Additions - AME 2.5 - Media Embedding for posts, sigs, vm's, groups and blogs (https://vborg.vbsupport.ru/showthread.php?t=202476)

The Geek 07-03-2009 10:57 AM

I have just uploaded AME 2.5.5 to address a couple of minor issues. Mainly surrounding editing of existing AME links that contain brackets inside the name. This could (in rare cases) also affect posts with multiple media URLs in them.

I also added another hook to extend additional functionality for media that fails to validate (i.e. a youtube link that doesn't allow external embedding). I do not currently have plans to extend this area further than I have done, but its there :)

Files changed:
  • forums/includes/ame_bbcode.php
  • forums/includes/xml/hooks_automediaembed.xml

I have also updated the ame_nomedia template to add the phrase 'External Embedding Not Available' as the title to the link. This appears if the definition does not validate along with an icon. If you want to make it more obvious to the user that AME is working, but the video won't embed, I suggest playing with that template (or use the new hook).

To upgrade:

Download the latest package
Unzip and upload the contents of the upload/forums folder into your own forums folder (be sure to upload ALL the files and folders choosing to overwrite existing files).
Import the product_ame.xml file into your admincp product system (choosing to overwrite existing version)

The Geek 07-03-2009 11:16 AM

Quote:

Originally Posted by Wayne Luke (Post 1840936)
Sorry if this has been posted before but there are too many posts in the thread to read them all.

I want to show YouTube HD in a 16:9 format and not the 4:3 format provided now. Anyone know how to change the definition to accommodate this?

Depends on a couple things. I moved the position of one of AMEs hooks in 2.5.5 to hopefully accommodate what I think you're after.

If only using the default youtube definition and you only want youtube videos with hd=1 in the URL to be a larger size, then just create a new plugin:

Hook Location: automediaembed_parse_bbcode_match_start
Title: Youtube HD Bigga Please
Code:
PHP Code:

if ($ameinfo['key'] == "youtube" && $ameinfo['zone'] == "post")
{
    if (
strpos($ameinfo['url'], "hd=1"))
    {
        
$ameinfo['width'] = "640";
        
$ameinfo['height'] = "480";
    }


Obviously adjust width and height as you fancy.

What this will do is check the definition key and the zone you are in. If the matching definition key is youtube and the zone is post, then it will check the URL for hd=1 (which is my understanding of how youtube marks HD URLs. It then overrides the zones size.

I am sure you can get even more creative :)

Anyhoo, hope this helps!

The Geek 07-03-2009 11:18 AM

Quote:

Originally Posted by newsoftw (Post 1840093)
Thanks for great helping and also after doing that, working start only youbue videos but youtube videos are twice a time show in post....please below link....

http://www.newsoftworld.com/forums/f...-nail-gun.html


please any idea ???

Double posting indicates duplicate definitions.

The Geek 07-03-2009 11:21 AM

Quote:

Originally Posted by Omanternity (Post 1839985)
Hey

Is there any possible way to make AME only come into effect when the URL is posted in it's URL form

http://youtube.com/etc

and not if it was inside a marked up text link [URL] ?

Is this possible at all ?

Not sure if I follow. vB wraps all text it thinks are URLs with URL tags before AME gets to it (as long as the option to automatically parse links in text is checked). AME only checks URL tags and not the text itself so you have a couple options:

1- Untick the option to parse links in text
2- Untick the 'Automatically embed media' option when posting

Hope that helps!

The Geek 07-03-2009 11:27 AM

Quote:

Originally Posted by Ryloth (Post 1839831)
According to the definition it is. Also if you wrap it in AME tags, it loads up just fine.

Btw I am using FF and not the advanced WYSIWYG



Definition:

[http://]*[a-z]*?[\.]?youtube\.[a-z]*?/watch\?v=([A-Z0-9._%-]*)[&\w;=\+_\-]*

Quote:

Originally Posted by Ryloth (Post 1839834)
update, i went into the definition and turned off Extract Information and youtube started working again just fine.

Looks like there is an issue w/ the Extract Information functionality.


the extract definition date value is:

value="http://www\.youtube\.com/v/([\w\-]*)?&

I think you are using another definition here.

[http://]*[a-z]*?[\.]?youtube\.[a-z]*?/watch\?v=([A-Z0-9._%-]*)[&\w;=\+_\-]*

Will not match

http://www.youtube.com/v/XXXX-XxXXxxX

Nor should it because http://www.youtube.com/v/XXXX-XxXXxxX in an address bar will not take you to a video as it is the movie object address. When AME validates, it uses

value="http://www\.youtube\.com/v/([\w\-]*)?&

Because that is the HTML that is in the source when the embed URL is present on the page. Otherwise it isn't there and instead 'Embedding disabled by request' or whatever.

I have tested this pretty throughly and while bugs in anything are inevitable, I am confident that the default install works as intended. If you are using custom or new definitions, that could be the culprit.

The Geek 07-03-2009 11:31 AM

Quote:

Originally Posted by wolfstream (Post 1839680)
If the video couldn't be embedded, there needs to be some sort of warning for the user, it only makes sense, but that would be why that youtube video didn't work right. In fact, if you look at most of them that don't work right (if not all), I'd bet you would see the same thing

If the video doesn't allow embedding, the page title will still appear and an icon will be displayed. Furthermore in 2.5.5 I put 'External embedding not available' in the anchor title. I also added a hook to enable modders to extend this functionality, but apart from that, not sure how much more I can do. Personally I would suggest editing the ame_nomedia template to maybe put text after the link like: (media cannot be embedded). I didn't do that by default because I didn't want to go overkill on visual hints.

The Geek 07-03-2009 11:35 AM

Quote:

Originally Posted by The DaveyG (Post 1838118)
Great mod.

I'm using this in conjunction with a Forms app. For example, I have the user enter the URL of a show on Hulu and it is supposed to automatically show up embedded on the thread that is generated. However, it's not changing the link into an imbed. Is there some setting I am missing or does this just not work on posts not made using the traditional means?

The forms app would need to hook into AME to prep and parse the text. Check out AMEs plugins to see how AME is doing it for blogs, visitor messages, posts, etc... for an idea of how to do it.

HTHs!

jkcerda 07-03-2009 06:51 PM

updated.

Break.com
ESPN
and AOL video are still NOT working:confused:

HMBeaty 07-03-2009 06:53 PM

Just FYI Geek, theres an error in the version checking of this modification

jkcerda 07-03-2009 07:11 PM

Quote:

Originally Posted by Redlinemotorsports (Post 1842257)
Just FYI Geek, theres an error in the version checking of this modification

dang, I just installed it too:o


All times are GMT. The time now is 07:29 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02033 seconds
  • Memory Usage 1,761KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php_printable
  • (8)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (5)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete