@@ -18,8 +18,8 @@ class DailymotionServiceAdapter extends AbstractServiceAdapter
18
18
/**
19
19
* AbstractVideoAdapter constructor.
20
20
*
21
- * @param string $url
22
- * @param string $pattern
21
+ * @param string $url
22
+ * @param string $pattern
23
23
* @param EmbedRendererInterface $renderer
24
24
*/
25
25
public function __construct ($ url , $ pattern , EmbedRendererInterface $ renderer )
@@ -64,72 +64,79 @@ public function getThumbNailSizes()
64
64
65
65
/**
66
66
* @param string $size
67
+ * @param bool $secure
67
68
*
68
69
* @return string
69
- *
70
70
* @throws InvalidThumbnailSizeException
71
71
*/
72
- public function getThumbnail ($ size )
72
+ public function getThumbnail ($ size, $ secure = false )
73
73
{
74
74
if (false == in_array ($ size , $ this ->getThumbNailSizes ())) {
75
75
throw new InvalidThumbnailSizeException ();
76
76
}
77
77
78
- return ' http ://www.dailymotion.com/ '. $ size. '/video/ ' . $ this ->videoId ;
78
+ return $ this -> getScheme ( $ secure ) . ' ://www.dailymotion.com/ ' . $ size . '/video/ ' . $ this ->videoId ;
79
79
}
80
80
81
81
/**
82
82
* Returns the small thumbnail's url.
83
83
*
84
+ * @param bool $secure
84
85
* @return string
86
+ * @throws InvalidThumbnailSizeException
85
87
*/
86
- public function getSmallThumbnail ()
88
+ public function getSmallThumbnail ($ secure = false )
87
89
{
88
90
//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 );
90
92
}
91
93
92
94
/**
93
95
* Returns the medium thumbnail's url.
94
96
*
97
+ * @param bool $secure
95
98
* @return string
99
+ * @throws InvalidThumbnailSizeException
96
100
*/
97
- public function getMediumThumbnail ()
101
+ public function getMediumThumbnail ($ secure = false )
98
102
{
99
103
//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 );
101
105
}
102
106
103
107
/**
104
108
* Returns the large thumbnail's url.
105
109
*
110
+ * @param bool $secure
106
111
* @return string
112
+ * @throws InvalidThumbnailSizeException
107
113
*/
108
- public function getLargeThumbnail ()
114
+ public function getLargeThumbnail ($ secure = false )
109
115
{
110
116
//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 );
112
118
}
113
119
114
120
/**
115
121
* Returns the largest thumnbnaail's url.
116
- *
122
+ * @param bool $secure
117
123
* @return string
124
+ * @throws InvalidThumbnailSizeException
118
125
*/
119
- public function getLargestThumbnail ()
126
+ public function getLargestThumbnail ($ secure = false )
120
127
{
121
128
//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 );
123
130
}
124
131
125
132
/**
126
133
* @param bool $autoplay
127
- *
134
+ * @param bool $secure
128
135
* @return string
129
136
*/
130
- public function getEmbedUrl ($ autoplay = false )
137
+ public function getEmbedUrl ($ autoplay = false , $ secure = false )
131
138
{
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 ' : '' );
133
140
}
134
141
135
142
/**
0 commit comments