• I want to be able to play that video on my own site without going to another site, not by uploading the video on my WordPress website, but by adding the link of the video on any site. I want to be able to add the link of the video on any site, not just from well-known sites such as youtube, dailymotion, instagram. Is there a code or plugin or theme you can recommend me for this?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    I would first try the video block and see if you can embed the videos from other sites.

    Hi @turkuaz1

    Kindly use the following snippet:-

    function _embed_video($atts){
      $output = '';
      $url = $atts['url'];
      if( !empty($url) ){
       $output = '<iframe width="100%" height="600" src="' . $url .'" title="Video player" frameborder="0" allowfullscreen="true"></iframe>';
      }
      return $output;
    }
    add_shortcode('_embed_video', '_embed_video');

    You need to use the following shortcode:-

    [_embed_video url="https://www.dailymotion.com/embed/video/x8ksmt6"]

    You can use any URL as required (Youtube, Dailymotion, Instagram). Anywhere you want, you can use this shortcode.

    Thread Starter turkuaz1

    (@turkuaz1)

    @niyaswp Where should I add this code?

    My second question= Is there a way for me to add dozens of videos with a single code?

    • This reply was modified 1 year, 4 months ago by turkuaz1.
    • This reply was modified 1 year, 4 months ago by turkuaz1.
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How can I play the video from another site on the website?’ is closed to new replies.