Send player logo with php SDK

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

Hi,

We apologize for the inconvenience. The management of the logo for the player was missing in the SDK. This gap is now filled thanks to version 1.0.2 of the SDK.

This release add new method to upload logo and define a link url:

$client->players->uploadLogo($sourcePath, $playerId, $link);

Thank you for your feedback.

Anthony

1 Like