@@ -18,8 +18,8 @@ class DailymotionServiceAdapter extends AbstractServiceAdapter
1818 /**
1919 * AbstractVideoAdapter constructor.
2020 *
21- * @param string $url
22- * @param string $pattern
21+ * @param string $url
22+ * @param string $pattern
2323 * @param EmbedRendererInterface $renderer
2424 */
2525 public function __construct ($ url , $ pattern , EmbedRendererInterface $ renderer )
@@ -64,72 +64,79 @@ public function getThumbNailSizes()
6464
6565 /**
6666 * @param string $size
67+ * @param bool $secure
6768 *
6869 * @return string
69- *
7070 * @throws InvalidThumbnailSizeException
7171 */
72- public function getThumbnail ($ size )
72+ public function getThumbnail ($ size, $ secure = false )
7373 {
7474 if (false == in_array ($ size , $ this ->getThumbNailSizes ())) {
7575 throw new InvalidThumbnailSizeException ();
7676 }
7777
78- return ' http ://www.dailymotion.com/ '. $ size. '/video/ ' . $ this ->videoId ;
78+ return $ this -> getScheme ( $ secure ) . ' ://www.dailymotion.com/ ' . $ size . '/video/ ' . $ this ->videoId ;
7979 }
8080
8181 /**
8282 * Returns the small thumbnail's url.
8383 *
84+ * @param bool $secure
8485 * @return string
86+ * @throws InvalidThumbnailSizeException
8587 */
86- public function getSmallThumbnail ()
88+ public function getSmallThumbnail ($ secure = false )
8789 {
8890 //Since this service does not provide other thumbnails sizes we just return the default size
89- return $ this ->getThumbnail (self ::THUMBNAIL_DEFAULT );
91+ return $ this ->getThumbnail (self ::THUMBNAIL_DEFAULT , $ secure );
9092 }
9193
9294 /**
9395 * Returns the medium thumbnail's url.
9496 *
97+ * @param bool $secure
9598 * @return string
99+ * @throws InvalidThumbnailSizeException
96100 */
97- public function getMediumThumbnail ()
101+ public function getMediumThumbnail ($ secure = false )
98102 {
99103 //Since this service does not provide other thumbnails sizes we just return the default size
100- return $ this ->getThumbnail (self ::THUMBNAIL_DEFAULT );
104+ return $ this ->getThumbnail (self ::THUMBNAIL_DEFAULT , $ secure );
101105 }
102106
103107 /**
104108 * Returns the large thumbnail's url.
105109 *
110+ * @param bool $secure
106111 * @return string
112+ * @throws InvalidThumbnailSizeException
107113 */
108- public function getLargeThumbnail ()
114+ public function getLargeThumbnail ($ secure = false )
109115 {
110116 //Since this service does not provide other thumbnails sizes we just return the default size
111- return $ this ->getThumbnail (self ::THUMBNAIL_DEFAULT );
117+ return $ this ->getThumbnail (self ::THUMBNAIL_DEFAULT , $ secure );
112118 }
113119
114120 /**
115121 * Returns the largest thumnbnaail's url.
116- *
122+ * @param bool $secure
117123 * @return string
124+ * @throws InvalidThumbnailSizeException
118125 */
119- public function getLargestThumbnail ()
126+ public function getLargestThumbnail ($ secure = false )
120127 {
121128 //Since this service does not provide other thumbnails sizes we just return the default size
122- return $ this ->getThumbnail (self ::THUMBNAIL_DEFAULT );
129+ return $ this ->getThumbnail (self ::THUMBNAIL_DEFAULT , $ secure );
123130 }
124131
125132 /**
126133 * @param bool $autoplay
127- *
134+ * @param bool $secure
128135 * @return string
129136 */
130- public function getEmbedUrl ($ autoplay = false )
137+ public function getEmbedUrl ($ autoplay = false , $ secure = false )
131138 {
132- return ' //www.dailymotion.com/embed/video/ '. $ this ->videoId . ($ autoplay ? '?amp&autoplay=1 ' : '' );
139+ return $ this -> getScheme ( $ secure ) . ' : //www.dailymotion.com/embed/video/ ' . $ this ->videoId . ($ autoplay ? '?amp&autoplay=1 ' : '' );
133140 }
134141
135142 /**
0 commit comments