Skip to content

Commit

Permalink
Merge pull request #10 from BJTheCod3r/feature---changed-method-access
Browse files Browse the repository at this point in the history
Feature   changed method access
  • Loading branch information
BJTheCod3r authored Jul 18, 2024
2 parents 637a128 + 8f70da3 commit 0693fe8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ gladly attend to it.

## Todo

* Add Tests
* Improve tests
* Add the remaining useful features available on Cloudflare Stream

## Contributing
Expand Down
4 changes: 2 additions & 2 deletions src/CloudflareStream.php
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ private function setCustomerDomain(): void
*/
public function getSignedUrl(string $id, int $expiresIn = 3600): array
{
$token = $this->signToken($id, $expiresIn);
$token = $this->getLocallySignedToken($id, $expiresIn);
return [
'hls' => "$this->customerDomain/$token/manifest/video.m3u8",
'dash' => "$this->customerDomain/$token/manifest/video.mpd"
Expand All @@ -440,7 +440,7 @@ public function getSignedUrl(string $id, int $expiresIn = 3600): array
* @param int|null $exp
* @return string
*/
private function signToken(string $uid, int $exp = null): string
public function getLocallySignedToken(string $uid, int $exp = null): string
{
$privateKey = base64_decode($this->pem);

Expand Down
14 changes: 7 additions & 7 deletions tests/Feature/CloudflareStreamTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,6 @@ class CloudflareStreamTest extends TestCase

protected string $accountId;

protected function setUp(): void
{
parent::setUp();
$this->apiBaseUrl = config('cloudflare-stream.base_url');
$this->accountId = config('cloudflare-stream.account_id');
}

/**
* @return void
*/
Expand Down Expand Up @@ -295,4 +288,11 @@ public function test_can_get_stream_signed_token_successfully(): void
$response = $stream->getStreamSignedToken($id);
$this->assertEquals($fakeResponse['result']['token'], $response['result']['token']);
}

protected function setUp(): void
{
parent::setUp();
$this->apiBaseUrl = config('cloudflare-stream.base_url');
$this->accountId = config('cloudflare-stream.account_id');
}
}

0 comments on commit 0693fe8

Please sign in to comment.