Support » Plugin: AMP for WP - Accelerated Mobile Pages » I have “The tag ‘video’ may only appear as a descendant of tag ‘noscript’.”

  • Resolved o6asan

    (@o6asan)


    Google Search Console gives the error like the topic title.

    I use a <video> tag on the comment of the post.
    When I replaced this tag, I mean <video src="/wp-content/uploads/2016_03_30_1445.mp4" controls="" class="alignleft"></video>, with the blelow, the error has gone.

    <amp-video controls
      width="640"
      height="360"
      layout="responsive"
      <source src="/wp-content/uploads/2016_03_30_1445.mp4"
        type="video/mp4" />
    </amp-video>

    But the video on non-AMP page disappears. How can I fix this on both AMP and non-AMP page?

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hi @o6asan,

    Try changing the code of the plugin to check if it’s working or not.

    Open comments.php of Design-2 present in templates/design-manager/design-2/elements/

    And change this code:
    $sanitizer = new AMPFORWP_Content( $comment_content, array(), apply_filters( 'ampforwp_content_sanitizers', array( 'AMP_Img_Sanitizer' => array() ) ) );

    Into this:

    $sanitizer = new AMPFORWP_Content( $comment_content, array(), apply_filters( 'ampforwp_content_sanitizers', array( 'AMP_Img_Sanitizer' => array(),
    					                          'AMP_Video_Sanitizer' => array() ) ) );

    Let me know if that helps or not.

    Thanks, @marqas.

    $sanitizer = new AMPFORWP_Content( $comment_content, array(), apply_filters( 'ampforwp_content_sanitizers', array( 'AMP_Img_Sanitizer' => array(),
    					                          'AMP_Video_Sanitizer' => array() ) ) );

    and
    <video src="/wp-content/uploads/2016_03_30_1445.mp4" controls="" class="alignleft"></video>
    give
    <amp-video src="/wp-content/uploads/2016_03_30_1445.mp4" controls="" class="alignleft" height="400" layout="fixed-height"></amp-video> and the error has gone.

    But, I cannot see the video on the AMP page.

    It is probably not this but should the source be explicitly defined as https with the full path given.

    https://www. …. /wp-content/uploads/2016_03_30_1445.mp4

    • This reply was modified 2 years, 3 months ago by frenchomatic.
    • This reply was modified 2 years, 3 months ago by frenchomatic.

    Thanks, @frenchomatic.

    But your suggestion made nothing change.

    Hi @marqas.

    I changed <video src="/wp-content/uploads/2016_03_30_1445.mp4" controls="" class="alignleft"></video> into <video src="/wp-content/uploads/2016_03_30_1445.mp4" controls=""></video>, and the video appeared on the AMP page.

    Thank you!!!

    Hi @o6asan,

    Thanks for letting us know, I have also added it in our next update, so you don’t have to worry about updating the plugin.

    Best Regards
    Marqas

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘I have “The tag ‘video’ may only appear as a descendant of tag ‘noscript’.”’ is closed to new replies.