Hi,
I was trying to create a customize player and I noticed the absence of any logo on the player. And uploading the logo is not available in the php SDK. So, based on the Api\Videos::uploadThumbnail method, I implemented uploadLogo on Api\Players :
public function uploadLogo($source, $playerId)
{
if (!is_readable($source)) {
throw new UnexpectedValueException("'$source' must be a readable source file.");
}
$resource = fopen($source, 'rb');
$stats = fstat($resource);
$length = $stats['size'];
if (0 >= $length) {
throw new UnexpectedValueException("'$source' is empty.");
}
$response = $this->browser->submit(
"/players/$playerId/logo",
array('file' => new FormUpload($source))
);
if (!$response->isSuccessful()) {
$this->registerLastError($response);
return null;
}
return $this->unmarshal($response);
}
Probably I did something wrong, but I receive a 400 error with this message : “Request payload is missing”. Which is not, I guess the request would not even be sent because of this exception : UnexpectedValueException("’$source’ is empty.");
We can’t either update the assets link in the php SDK.
Thank you,
Sylvain