Как бы я мог получить видео, которое хранится в моем хранилище s3, а затем отобразить его как видео (<video>)
на моем веб-сайте, используя sdk для php, если у меня есть какой-то код, который выглядит следующим образом:
require 'vendor/autoload.php';
use Aws\S3\S3Client;
use Aws\S3\Exception\S3Exception;
$bucket = 'garbage';
$key = 'garbage';
$s3 = new S3Client([
'version' => 'latest',
'region' => 'us-west-1',
'scheme' => 'http',
'credentials' => [
'key' => 'garbage',
'secret' => 'garbage',
]
]);
try {
// Get the object.
$result = $s3->getObject([
'Bucket' => $bucket,
'Key' => $key
]);
// Display the object in the browser.
header("Content-Type: {$result['ContentType']}");
echo $result['Body'];
} catch (S3Exception $e) {
echo $e->getMessage() . PHP_EOL;
}