0

Why do both these work when embedding a video iframe in a Rails application?

<iframe src="//player.vimeo.com/video/...>

and

<iframe src="https://player.vimeo.com/video/...>

Please enlighten me. I've seen it both ways. Which is preferable?

Meltemi
  • 37,979
  • 50
  • 195
  • 293

1 Answers1

0

Using // infers the protocol from the URL from which the root page is served. Navigating to a site https://yoursite.com would mean all // links would also be served using HTTPS. This can be helpful if you're running the same page in a local environment that is using HTTP, and don't want to change it when pushing it to a production environment served using HTTPS.

Alexa Y
  • 1,854
  • 1
  • 10
  • 13