WordPress.org

Ready to get started?Download WordPress

Forums

Youtube shortcode
Videos not loading correctly on iOS devices (6 posts)

  1. bigspring
    Member
    Posted 1 year ago #

    I want to report a potential bug with the shortcode. It only seems to have started recently but isn't related to the iOS 6.1.3 update.

    I'm trying to view this video:

    http://www.themag.co.uk/the-mag-articles/video-exclusive-yohan-cabaye-the-model/

    I have the same problem with other videos on the site too.

    It works fine in browsers on a computer and on an Android, but will not load on an iPad or iPhone 5. When you click on the video, the iPad fires up the YouTube app and reports "Error loading YouTube Link".

    I've tried both the short and full links as the src in the shortcode and both have the same issue.

    Is anyone else getting this? And any idea what could be causing the problem?

    http://wordpress.org/extend/plugins/youtube-shortcode/

  2. teamGool
    Member
    Posted 1 year ago #

    yep I'm getting the same thing on iOS 6.1.3. Any ideas yet?

  3. teamGool
    Member
    Posted 1 year ago #

    I've got rid of this plugin as I don't actually need it, can use oEmbed:

    http://codex.wordpress.org/Embeds

    Unfortunately all my previous embeds will need to be changed, a real PITA!

  4. bmtoth
    Member
    Posted 1 year ago #

    I'm having the same issue.
    Anyone ever find a fix for this?

  5. mordenes
    Member
    Posted 1 year ago #

    I've got the same issue, the problem is the plugin is detecting the device and loading a different code. Basically is calling the prefix vnd.youtube for android and iOS. Now the iOS prefix for youtube is just "youtube" so the solution is really simple:

    youtube_shortcode.php ::: line 206

    OLD
    // Embedded Youtube player
                if ($this->ios || $this->android) {
                    $link = 'vnd.youtube:'.$video_id;
                // Link to Youtube's mobile site
    	     } else {
    
    SOLUTION
    // Embedded Youtube player
                if ($this->android) {
                    $link = 'vnd.youtube:'.$video_id;
                // Link to Youtube's mobile site
       	     } else if ($this->ios) {
    	    $link = 'youtube:'.$video_id;
                } else {
  6. bmtoth
    Member
    Posted 1 year ago #

    Awesome.
    Works perfectly now!
    Thanks!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.