Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
db0c16d
added video download endpoint
Dec 21, 2017
84cc059
Merge pull request #1 from wow/video-download-urls
wow Dec 21, 2017
aa072ca
video manager meta changed to 1.5
wow Dec 21, 2017
b9a87c5
Merge pull request #2 from wow/api-client-version-0-15-1
wow Dec 21, 2017
9bfa0cd
Updated
wow Dec 21, 2017
24d908b
Merge pull request #3 from wow/improvement-for-download-video-urls
wow Dec 21, 2017
cdb2d32
Consuming Transcoding Status Endpoint. New Entity VideoTranscodingSta…
arch1pel Apr 11, 2018
55d02d9
added Thumbnail Collection endpoint and respective entities
arch1pel Apr 12, 2018
00fd63d
Merge pull request #4 from wow/add-use-of-thumbnail-download-url-endp…
arch1pel Apr 12, 2018
38163d7
use thumbnail upload functionality
arch1pel Apr 13, 2018
95c9c34
Merge pull request #5 from wow/add-use-of-thumbnail-download-url-endp…
arch1pel Apr 13, 2018
7632296
publish videos via api
arch1pel Apr 14, 2018
7717ffd
Merge pull request #6 from wow/add-use-of-thumbnail-download-url-endp…
arch1pel Apr 14, 2018
1061f5f
fixed transcoding namespace
wow Apr 15, 2018
e512f49
added function to activate new thumbnail. ApiEndpoint Update Specific…
arch1pel Oct 22, 2018
4aa04da
Merge pull request #7 from wow/add-use-of-thumbnail-download-url-endp…
wow Oct 22, 2018
3df9b80
updated thumbnail function
wow Dec 3, 2018
6b81a27
Merge pull request #8 from wow/update-for-thumbnail
wow Dec 3, 2018
1540da1
added ad config ep
wow Mar 13, 2019
a2ec351
Merge pull request #9 from wow/add-ad-config-call
wow Mar 13, 2019
2830480
added ep for update video
wow Mar 18, 2019
515f345
Merge pull request #10 from wow/update-video-data
wow Mar 18, 2019
99c495c
added ep for update video
wow Mar 18, 2019
c051eff
added ep for update video
wow Mar 18, 2019
ecab2ce
Merge pull request #11 from wow/update-video-data
wow Mar 18, 2019
5c25164
added ep for update video
wow Mar 18, 2019
19014ef
added ep for update video
wow Mar 18, 2019
80dbec0
added ep for update video
wow Mar 18, 2019
40e6f16
added ep for update video
wow Mar 18, 2019
ec67aba
Merge pull request #12 from wow/update-video-data
wow Mar 18, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"namshi/jose": "^6.0 || ^7.0",
"jms/serializer": "^1.0",
"guzzlehttp/guzzle": "^5.0 || ^6.0",
"movingimage/video-manager-meta": "dev-master",
"movingimage/video-manager-meta": "^1.5",
"psr/cache": "^1.0",
"cache/void-adapter": "^1.0"
},
Expand Down
130 changes: 130 additions & 0 deletions lib/ApiClient/AbstractApiClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,12 @@
use MovingImage\Client\VMPro\Entity\EmbedCode;
use MovingImage\Client\VMPro\Entity\Video;
use MovingImage\Client\VMPro\Entity\Attachment;
use MovingImage\Client\VMPro\Entity\VideoDownloadUrl;
use MovingImage\Client\VMPro\Entity\VideoRequestParameters;
use MovingImage\Client\VMPro\Entity\VideosRequestParameters;
use MovingImage\Client\VMPro\Entity\VideoThumbnailCollection;
use MovingImage\Client\VMPro\Entity\VideoTranscodingStatus;
use MovingImage\Client\VMPro\Exception;
use MovingImage\Client\VMPro\Interfaces\ApiClientInterface;
use MovingImage\Client\VMPro\Util\ChannelTrait;
use MovingImage\Client\VMPro\Util\Logging\Traits\LoggerAwareTrait;
Expand Down Expand Up @@ -150,6 +154,20 @@ public function getVideoUploadUrl($videoManagerId, $videoId)
: $response->getHeader('location');
}

/**
* {@inheritdoc}
*/
public function getVideoDownloadUrls($videoManagerId, $videoId)
{
$response = $this->makeRequest('GET', sprintf('videos/%s/download-urls', $videoId), [
self::OPT_VIDEO_MANAGER_ID => $videoManagerId,
]);

$response = $response->getBody()->getContents();

return $this->deserialize($response, 'ArrayCollection<'.VideoDownloadUrl::class.'>');
}

/**
* {@inheritdoc}
*/
Expand Down Expand Up @@ -284,4 +302,116 @@ public function searchChannels($videoManagerId, ChannelsRequestParameters $param

return $collection;
}

/**
* {@inheritdoc}
*/
public function getTranscodingStatus($videoManagerId, $videoId)
{
$response = $this->makeRequest('GET', sprintf('videos/%s/transcoding-status', $videoId), [
self::OPT_VIDEO_MANAGER_ID => $videoManagerId,
]);

$response = $response->getBody()->getContents();

return $this->deserialize($response, 'ArrayCollection<'.VideoTranscodingStatus::class.'>');
}

/**
* {@inheritdoc}
*/
public function getThumbnailCollection($videoManagerId, $videoId)
{
$response = $this->makeRequest('GET', sprintf('videos/%s/thumbnails', $videoId), [
self::OPT_VIDEO_MANAGER_ID => $videoManagerId,
]);

$response = $response->getBody()->getContents();

return $this->deserialize($response, 'ArrayCollection<'.VideoThumbnailCollection::class.'>');
}

/**
* {@inheritdoc}
*/
public function createThumbnailForVideo($videoManagerId, $videoId)
{
$response = $this->makeRequest('POST', sprintf('videos/%s/thumbnails', $videoId), [
self::OPT_VIDEO_MANAGER_ID => $videoManagerId,
]);

return $response->getHeader('Location');
}

/**
* {@inheritdoc}
*/
public function getThumbnailUploadUrl($videoManagerId, $videoId, $thumbnailId)
{
$response = $this->makeRequest('GET', sprintf('videos/%s/thumbnails/%s/upload-url', $videoId, $thumbnailId), [
self::OPT_VIDEO_MANAGER_ID => $videoManagerId,
]);

return $response->getHeader('Location');
}

/**
* {@inheritdoc}
*/
public function publishVideoAsset($videoManagerId, $videoId)
{
$json = $this->buildJsonParameters(['published' => 'true'], ['downloadable' => 'true']);
$response = $this->makeRequest('PATCH', sprintf('videos/%s', $videoId), [
self::OPT_VIDEO_MANAGER_ID => $videoManagerId,
'json' => $json
]);

return $response->getStatusCode();
}

/**
* {@inheritdoc}
*/
public function updateSpecificThumbnail($videoManagerId, $videoId, $thumbnailId)
{
$json = $this->buildJsonParameters(['active' => 'true'], []);
$response = $this->makeRequest('PATCH', sprintf('videos/%s/thumbnails/%s', $videoId, $thumbnailId), [
self::OPT_VIDEO_MANAGER_ID => $videoManagerId,
'json' => $json
]);

return $response->getStatusCode();
}

/**
* @param $videoManagerId
* @return string
* @throws \Exception
*/
public function getAdConfigurations($videoManagerId)
{
$response = $this->makeRequest('GET', 'ad_configurations', [
self::OPT_VIDEO_MANAGER_ID => $videoManagerId,
]);

return $response->getBody()->getContents();
}

/**
* @param $videoManagerId
* @param $videoId
* @param array $params
* @return int
* @throws \Exception
*/
public function updateVideoData($videoManagerId, $videoId, array $params = [])
{
$response = $this->makeRequest('PATCH', sprintf('videos/%s', $videoId), [
self::OPT_VIDEO_MANAGER_ID => $videoManagerId,
'json' => $params,
]);

return $response->getStatusCode();
}
}

136 changes: 136 additions & 0 deletions lib/Entity/VideoDownloadUrl.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
<?php

namespace MovingImage\Client\VMPro\Entity;

use JMS\Serializer\Annotation\Type;

/**
* Class VideoDownloadUrl
*/
class VideoDownloadUrl
{
/**
* @Type("string")
*/
private $quality;

/**
* @Type("string")
*/
private $profileKey;

/**
* @Type("string")
*/
private $fileExtension;

/**
* @Type("string")
*/
private $url;

/**
* @Type("integer")
*/
private $fileSize;

/**
* @return string
*/
public function getQuality()
{
return $this->quality;
}

/**
* @param string $quality
*
* @return VideoDownloadUrl
*/
public function setQuality($quality)
{
$this->quality = $quality;

return $this;
}

/**
* @return string
*/
public function getProfileKey()
{
return $this->profileKey;
}

/**
* @param string $profileKey
*
* @return VideoDownloadUrl
*/
public function setProfileKey($profileKey)
{
$this->profileKey = $profileKey;

return $this;
}

/**
* @return string
*/
public function getFileExtension()
{
return $this->fileExtension;
}

/**
* @param string $fileExtension
*
* @return VideoDownloadUrl
*/
public function setFileExtension($fileExtension)
{
$this->fileExtension = $fileExtension;

return $this;
}

/**
* @return string
*/
public function getUrl()
{
return $this->url;
}

/**
* @param string $url
*
* @return VideoDownloadUrl
*/
public function setUrl($url)
{
$this->url = $url;

return $this;
}

/**
* @return int
*/
public function getFileSize()
{
return $this->fileSize;
}

/**
* @param int $fileSize
*
* @return VideoDownloadUrl
*/
public function setFileSize($fileSize)
{
$this->fileSize = $fileSize;

return $this;
}
}
87 changes: 87 additions & 0 deletions lib/Entity/VideoThumbnail.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
<?php

namespace MovingImage\Client\VMPro\Entity;

use JMS\Serializer\Annotation as Serializer;
use JMS\Serializer\Annotation\Type;

/**
* Class VideoThumbnail
*/
class VideoThumbnail
{
/**
* @Type("string")
*/
private $quality;

/**
* @Type("string")
*/
private $url;

/**
* @Type("array<string, int>")
*/
private $dimension;

/**
* @return mixed
*/
public function getQuality()
{
return $this->quality;
}

/**
* @param string $quality
*
* @return $this
*/
public function setQuality($quality)
{
$this->quality = $quality;

return $this;
}

/**
* @return string
*/
public function getUrl()
{
return $this->url;
}

/**
* @param mixed $url
*
* @return $this
*/
public function setUrl($url)
{
$this->url = $url;

return $this;
}

/**
* @return mixed
*/
public function getDimension()
{
return $this->dimension;
}

/**
* @param mixed $dimension
*
* @return $this
*/
public function setDimension($dimension)
{
$this->dimension = $dimension;

return $this;
}
}
Loading