diff --git a/includes/media_youtube.admin.inc b/includes/media_youtube.admin.inc
index 5149c75..8a4739f 100644
--- a/includes/media_youtube.admin.inc
+++ b/includes/media_youtube.admin.inc
@@ -124,6 +124,13 @@ function media_youtube_admin_form() {
     '#description' => t("If checked, the HTML5 capable player will be used instead of the older flash-based. This is achieved as an iframe, also allowing for mobile display of the video."),
   );
 
+  $form['player']['player_options'][media_youtube_variable_name('force_https')] = array(
+    '#type' => 'checkbox',
+    '#title' => t('Always use a secure connection (https) to embed videos'),
+    '#default_value' => media_youtube_variable_get('force_https'),
+    '#description' => t("If checked, the video will always be embedded through a secure SSL connection (https). By default a secure connection is only used when a page is being viewed through https."),
+  );
+
   $form['player']['jwflv'] = array(
     '#type' => 'fieldset',
     '#title' => t('JW FLV Media Player Options'),
diff --git a/includes/media_youtube.media_mover.inc b/includes/media_youtube.media_mover.inc
index 4669b11..d599b22 100644
--- a/includes/media_youtube.media_mover.inc
+++ b/includes/media_youtube.media_mover.inc
@@ -92,7 +92,7 @@ function media_youtube_upload_video($file, $configuration) {
   try {
     $video = $youtube->insertEntry($upload, MEDIA_YOUTUBE_UPLOAD_URL, 'Zend_Gdata_YouTube_VideoEntry');
     $url = media_youtube_video_url($video->getVideoId());
-    watchdog('media_youtube', 'Uploaded file !file to Youtube: !video', array('!file' => $fileinfo['basename'], '!video' => l($url, $url)), WATCHDOG_NOTICE, l($title, 'http://www.youtube.com/watch?v='. $story_id, array('absolute' => TRUE)));
+    watchdog('media_youtube', 'Uploaded file !file to Youtube: !video', array('!file' => $fileinfo['basename'], '!video' => l($url, $url)), WATCHDOG_NOTICE, l($title, media_youtube_variable_get('media_youtube_https') . 'www.youtube.com/watch?v='. $story_id, array('absolute' => TRUE)));
     return $url;
   }
   catch (Zend_Gdata_App_HttpException $httpException) {
diff --git a/includes/media_youtube.variables.inc b/includes/media_youtube.variables.inc
index 0490cda..a57fba6 100644
--- a/includes/media_youtube.variables.inc
+++ b/includes/media_youtube.variables.inc
@@ -193,7 +193,15 @@ function media_youtube_variable_default($name = NULL) {
       // If that's been run improperly, then this will stay FALSE, and
       // we need to self-correct.
       'media_youtube_update_6012' => FALSE,
+
+      // Use https if page is accessed through https.
+      'media_youtube_https' => ((!isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https://' : 'http://'),
     );
+
+    // Force the use of https if that setting is activated.
+    if (media_youtube_variable_get('force_https') == 1) {
+      $defaults['media_youtube_https'] = 'https://';
+    }
   }
 
   if (!isset($name)) {
diff --git a/media_youtube.module b/media_youtube.module
index 7409737..03a2559 100644
--- a/media_youtube.module
+++ b/media_youtube.module
@@ -251,9 +251,9 @@ function media_youtube_media_mover($op = NULL, $action = NULL, $configuration =
 function media_youtube_video_url($id) {
   if (strpos($id, 'PLAYLIST_') === 0) {
     // This is a youtube playlist.
-    return 'http://youtube.com/p/'. substr($id, 9);
+    return media_youtube_variable_get('media_youtube_https') . 'youtube.com/p/'. substr($id, 9);
   }
-  return url('http://www.youtube.com/watch', array('query' => 'v='. $id));
+  return url(media_youtube_variable_get('media_youtube_https') . 'www.youtube.com/watch', array('query' => 'v='. $id));
 }
 
 /**
@@ -542,7 +542,7 @@ function media_youtube_emfield_data($video_id) {
   // Get info from a youtube playlist.
   if (strpos($video_id, 'PLAYLIST_') === 0) {
     $playlist_id = substr($video_id, 9);
-    $url = 'http://youtube.com/p/'. $playlist_id;
+    $url = media_youtube_variable_get('media_youtube_https') . 'youtube.com/p/'. $playlist_id;
     $data['playlist'] = 1;
 
     // Get the large thumbnail of the first video.
@@ -567,10 +567,10 @@ function media_youtube_emfield_data($video_id) {
   }
   // Get info from a single video.
   else {
-    $url = 'http://youtube.com/v/'. $video_id;
+    $url = media_youtube_variable_get('media_youtube_https') . 'youtube.com/v/'. $video_id;
     $data['playlist'] = 0;
     // Get the large thumbnail.
-    $data['thumbnail']['url'] = 'http://img.youtube.com/vi/'. $video_id .'/0.jpg';
+    $data['thumbnail']['url'] = media_youtube_variable_get('media_youtube_https') . 'img.youtube.com/vi/'. $video_id .'/0.jpg';
   }
 
   $response = emfield_request_header('youtube', $url);
diff --git a/providers/emvideo/youtube.inc b/providers/emvideo/youtube.inc
index 8f365b1..52ef041 100644
--- a/providers/emvideo/youtube.inc
+++ b/providers/emvideo/youtube.inc
@@ -180,7 +180,7 @@ function emvideo_youtube_thumbnail($field, $item, $formatter, $node, $width, $he
   }
 
   // Always return the larger image, since we're storing images locally.
-  $tn = "http://img.youtube.com/vi/{$item['value']}/0.jpg";
+  $tn = media_youtube_variable_get('media_youtube_https') . "img.youtube.com/vi/{$item['value']}/0.jpg";
 
   return $tn;
 }
diff --git a/themes/media_youtube.theme.inc b/themes/media_youtube.theme.inc
index a4cc8ea..c05afc8 100644
--- a/themes/media_youtube.theme.inc
+++ b/themes/media_youtube.theme.inc
@@ -49,7 +49,7 @@ function template_preprocess_media_youtube_html5(&$variables) {
   $variables['autoplay'] = isset($variables['autoplay']) ? $variables['autoplay'] : media_youtube_variable_get('autoplay');
   $variables['autoplay'] = $variables['autoplay'] ? '1' : '0';
 
-  $variables['url'] = "http://www.youtube.com/embed/{$variables['video_id']}";
+  $variables['url'] = media_youtube_variable_get('media_youtube_https') . "www.youtube.com/embed/{$variables['video_id']}";
   $variables['query_defaults'] = array(
     'autoplay' => $variables['autoplay'],
     'rel' => $variables['related'],
@@ -69,7 +69,7 @@ function template_preprocess_media_youtube_default_external(&$variables) {
 
   $variables['flashvars'] = drupal_query_string_encode(array('playerMode' => 'embedded'));
   $video_id = $variables['video_id'];
-  $variables['url'] = isset($variables['url']) ? $variables['url'] : "http://www.youtube.com/v/$video_id";
+  $variables['url'] = isset($variables['url']) ? $variables['url'] : media_youtube_variable_get('media_youtube_https') . "www.youtube.com/v/$video_id";
   $variables['url'] = check_plain($variables['url']);
   $variables['width'] = check_plain($variables['width']);
   $variables['height'] = check_plain($variables['height']);
@@ -182,12 +182,12 @@ function template_preprocess_media_youtube_flash(&$variables) {
     // Create a URL from our options.
     if ($variables['item']['data']['playlist']) {
       $video_id = substr($video_id, 9);
-      $url = "http://www.youtube.com/p/$video_id?$related$autoplay_value$colors$border$high_quality$display_info$enablejsapi$fs";
+      $url = media_youtube_variable_get('media_youtube_https') . "www.youtube.com/p/$video_id?$related$autoplay_value$colors$border$high_quality$display_info$enablejsapi$fs";
       // FLV Player doesn't support playlists, so we need to fall back.
       $variables['use_flv'] = FALSE;
     }
     else {
-      $url = "http://www.youtube.com/v/$video_id?$related$autoplay_value$colors$border$high_quality$display_info$enablejsapi$fs";
+      $url = media_youtube_variable_get('media_youtube_https') . "www.youtube.com/v/$video_id?$related$autoplay_value$colors$border$high_quality$display_info$enablejsapi$fs";
     }
 
     // Find the path to the JW FLV Media Player.
