0

I'm embedding videos from Instagram in my website using below URL:

https://www.instagram.com/p/Bp4I3hRhd_v/embed 

Embedding it with an iframe:

<iframe src="https://www.instagram.com/p/Bp4I3hRhd_v/embed" frameborder="0" scrolling="yes" allowtransparency="true" width="450" height="450"></iframe>

Is there any way to stop playing this video when it is no more on screen (or user has already scrolled away from it)?

PS. I have already tried all the solutions given on internet for youtube videos but it doesn't work for Instagram videos because Insta videos has different embedding pattern then YT ones.

Rupali
  • 1,068
  • 1
  • 12
  • 18

1 Answers1

-1

use the below URL's for your job

how can I pause a youtube embed when a user scrolls away (or)

https://fjorgedigital.com/insights/blog/play-youtube-videos-on-scroll-over/

  • Thanks for your answer but I'm not embedding youtube videos, they are instagram videos. It embeds in a different way than youtube ones, hence I cannot have this object YT.Player to controller Insta videos. – Rupali Jan 31 '19 at 07:44
  • Is it stop is working on clicking of the video. If that works write a method which makes click on that area automatically through the code while scrolling the screen. This is the one option to forcefully stop or start something. – Anil Bandela Feb 01 '19 at 15:43
  • We cannot do cross origin operations within iFrames. – Rupali Feb 04 '19 at 12:02