Skip to content

Commit 807827b

Browse files
committed
Added video scaling to PHP
1 parent 77b08f1 commit 807827b

File tree

2 files changed

+39
-3
lines changed

2 files changed

+39
-3
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"homepage": "https://grabz.it/",
66
"description": "Use our API to allow your app to create images, DOCX documents, videos, rendered HTML and PDF's from URL's or raw HTML. Additionally GrabzIt allows you to convert online videos into animated GIF's or HTML tables into CSV's.",
77
"license": "MIT",
8-
"version":"3.5.3.1",
8+
"version":"3.5.4",
99
"autoload": {
1010
"psr-4": {
1111
"GrabzIt\\": "lib/"

lib/GrabzItVideoOptions.php

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ class GrabzItVideoOptions extends GrabzItBaseOptions
66
private $customWaterMarkId = null;
77
private $browserWidth = null;
88
private $browserHeight = null;
9+
private $width = null;
10+
private $height = null;
911
private $start = null;
1012
private $duration = null;
1113
private $framesPerSecond = null;
@@ -96,6 +98,38 @@ public function getBrowserHeight()
9698
return $this->browserHeight;
9799
}
98100

101+
/*
102+
Set the width of the resulting video in pixels
103+
*/
104+
public function setWidth($value)
105+
{
106+
$this->width = $value;
107+
}
108+
109+
/*
110+
Get the width of the resulting video in pixels
111+
*/
112+
public function getWidth()
113+
{
114+
return $this->width;
115+
}
116+
117+
/*
118+
Set the height of the resulting video in pixels
119+
*/
120+
public function setHeight($value)
121+
{
122+
$this->height = $value;
123+
}
124+
125+
/*
126+
Get the height of the resulting video in pixels
127+
*/
128+
public function getHeight()
129+
{
130+
return $this->height;
131+
}
132+
99133
/*
100134
Set a custom watermark to add to the video.
101135
*/
@@ -226,16 +260,18 @@ public function _getSignatureString($applicationSecret, $callBackURL, $url = nul
226260
"|".$this->nullToEmpty($this->browserHeight)."|".$this->nullToEmpty($this->browserWidth)."|".$this->nullToEmpty($this->getCustomId())."|".
227261
$this->nullToEmpty($this->customWaterMarkId)."|".$this->nullToEmpty($this->start)."|".
228262
$this->nullToEmpty(intval($this->requestAs))."|".$this->nullToEmpty($this->getCountry())."|".$this->nullToEmpty($this->getExportURL())."|".
229-
$this->nullToEmpty($this->waitForElement)."|".$this->nullToEmpty($this->getEncryptionKey()."|".
263+
$this->nullToEmpty($this->waitForElement)."|".$this->nullToEmpty($this->getEncryptionKey())."|".
230264
$this->nullToEmpty(intval($this->noAds))."|".$this->nullToEmpty($this->post)."|".$this->nullToEmpty($this->getProxy())."|".$this->nullToEmpty($this->address)."|".$this->nullToEmpty(intval($this->noCookieNotifications))."|".
231-
$this->nullToEmpty($this->clickElement)."|".$this->nullToEmpty($this->framesPerSecond)."|".$this->nullToEmpty($this->duration));
265+
$this->nullToEmpty($this->clickElement)."|".$this->nullToEmpty($this->framesPerSecond)."|".$this->nullToEmpty($this->duration)."|".$this->nullToEmpty($this->width)."|".$this->nullToEmpty($this->height);
232266
}
233267

234268
public function _getParameters($applicationKey, $sig, $callBackURL, $dataName, $dataValue)
235269
{
236270
$params = $this->createParameters($applicationKey, $sig, $callBackURL, $dataName, $dataValue);
237271
$params['bwidth'] = $this->nullToEmpty($this->browserWidth);
238272
$params['bheight'] = $this->nullToEmpty($this->browserHeight);
273+
$params['width'] = $this->nullToEmpty($this->width);
274+
$params['height'] = $this->nullToEmpty($this->height);
239275
$params['duration'] = $this->nullToEmpty($this->duration);
240276
$params['waitfor'] = $this->nullToEmpty($this->waitForElement);
241277
$params['customwatermarkid'] = $this->nullToEmpty($this->customWaterMarkId);

0 commit comments

Comments
 (0)