logo

$10
Change plugin from embedding youtube embed code

I have a plugin called MyVideo Poster 2.

It automatically embeds youtube videos from a specified user. Within the plugin you can specify a custom field to drop the embed code in. What I would like it to do is instead of dropping in the embed code I would like it to drop in the url of the video.

For example:

Current setting:
<iframe title="YouTube video player" width="640" height="390" src="http://www.youtube.com/embed/V38oYFSwn8c" frameborder="0" allowfullscreen></iframe> 


Modified setting:
http://www.youtube.com/watch?v=V38oYFSwn8c

The plugin is available for download here:
http://dl.dropbox.com/u/14299011/myvideoposter.zip

kayode brown | 03/31/11 at 9:16pm | Edit

Previous versions of this question: 03/31/11 at 9:35pm

(2) Possible Answers Submitted...

  • avatar
    Last edited:
    03/31/11
    9:47pm
    Lew Ayotte says:

    You know WordPress does this automatically, all you need to do is paste the URL of the video you want to embed...

    http://codex.wordpress.org/Embeds

    • 03/31/11 9:50pm

      kayode brown says:

      I know, but I want it to be an automatic feature. This plugin runs as a cron, therefore making the site updated every hour.

    • 03/31/11 9:52pm

      Lew Ayotte says:

      I don't follow... WordPress' oEmbed feature is automatic. No extra plugins necessary. (see the link)

    • 03/31/11 9:59pm

      kayode brown says:

      You would still have to copy the url of the youtube video. This plugin runs automatically. Meaning, I would upload a video to my youtube channel, and my website (this plugin) would automatically check my youtube rss feed and update my website accordingly.

      Here this is the plugin in.
      http://cleverplugins.com/shop/videoposter2/

    • 03/31/11 10:15pm

      Lew Ayotte says:

      Oh, I see... I thought you just wanted to be able to paste the video URL in a post.

  • avatar
    Last edited:
    03/31/11
    11:45pm
    Denzel Chia says:

    Hi,

    Thanks for sending me a message.
    Not sure what you want. I assume you want to update_post_meta with url instead of embed code.

    Open up myvideoposter.php with an editor that has line numbers.
    go to line number 1575
    change;


    update_post_meta($postresult, $myvideoposter_custommetadatanamevideo, $yembed);


    to

    update_post_meta($postresult, $myvideoposter_custommetadatanamevideo, $embedyurl);


    Thanks.
    Denzel

    • 03/31/11 11:04pm

      kayode brown says:

      Thanks for the rapid reply,

      I tried that and it it did the following:

      z2lZKn3TdKk

      instead of

      http://www.youtube.com/v/z2lZKn3TdKk

    • 03/31/11 11:12pm

      Denzel Chia says:

      Hi,

      Ok, maybe a quick hack to reconstruct back url can fixed that.

      Now use this instead.
      change line 1575 to


      $full_url = "http://www.youtube.com/v/".$embedyurl;
      update_post_meta($postresult, $myvideoposter_custommetadatanamevideo, $full_url);


      Thanks.

    • 03/31/11 11:29pm

      kayode brown says:

      I tried that and now its blank.

    • 03/31/11 11:33pm

      Denzel Chia says:

      Hi,

      Never mind. Is this on your test blog?
      If yes, please eamil me ftp access and admin access to email[at]denzeldesigns.com

      I will add it into the script myself.
      Do not want to waste anymore time here.

      WPQuestions is breaking the code I posted.
      Try again here.



      $full_url = "http://www.youtube.com/v/".$embedyurl;
      update_post_meta($postresult, $myvideoposter_custommetadatanamevideo, $full_url);



      Thanks.
      Denzel

    • 03/31/11 11:34pm

      kayode brown says:

      I didn't close it. one second let me try again.

This question has expired.





Current status of this question: Completed