12345678910111213141516171819202122232425262728293031323334353637383940 |
- $(document).ready(function() {
-
-
-
- var dictionary_of_embed_urls_for_different_services = {
- "youtube" : 'https://www.youtube-nocookie.com/embed/VIDEO_ID_GOES_HERE',
- "vimeo" : 'https://player.vimeo.com/video/VIDEO_ID_GOES_HERE'
- };
- $('body').on("click",'img.video-embed-dummy-image',function(event) // Whenever an image with the class "video-embed-dummy-image" is clicked...
- {
-
- var image_that_was_clicked = $(this);
-
- var video_id = $(this).attr('id');
- var service_name = $(this).attr('embed-service');
-
-
- var src_for_this_video = dictionary_of_embed_urls_for_different_services[service_name].replace("VIDEO_ID_GOES_HERE", video_id);
-
- $(this).fadeOut(250, function() {
- image_that_was_clicked.replaceWith('<iframe class="embedded_privacy_video" src="' + src_for_this_video + '" frameborder="0" allowfullscreen></iframe>')
- });
- });
- })
|