You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 20, 2019. It is now read-only.
I can't stream the S3 video/Image while downloading. I can able to read the private bucket by using my aws.accessKeyId and aws.secretKey. I have used the below way.
**method-1:**
def loadS3File(filename: String) = Action { implicit request =>
try {
val bucket = S3("user")
val result = bucket.get(filename)
val file = Await.result(result, 60 seconds)
val BucketFile(name, contentType, content, acl, headers) = file
Ok.chunked(Enumerator(content)).as(contentType);
}
catch {
case e: Exception =>
BadRequest("Error: " + e.getMessage)
}
}
**method-2:**
def loadS3File(filename: String) = Action.async {
val bucket = S3("user")
bucket.get(filename).map {
case BucketFile(name, contentType, content, acl, headers) =>
val byteString: ByteString = ByteString.fromArray(content)
Ok.chunked(Enumerator(byteString)).as(contentType)
}
}
It waits to read the whole file content from S3. But the it doesn't return video to html. If I tried to show the S3 image, it read the whole image content from S3 and return to the html successfully.
I can't stream the video/Image while downloading in progress.
The text was updated successfully, but these errors were encountered:
The library does not support streaming out-of-the box. You might want to check out this thread on stackoverflow to get a feel of the complexity. You can also check #42
As for now I recommend you use the library to create an url directly to the file and use that with your videoplayer. This has the added benefit that the file does not need to travel through your server but goes directly from s3 to the browser of the client.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I can't stream the S3 video/Image while downloading. I can able to read the private bucket by using my aws.accessKeyId and aws.secretKey. I have used the below way.
Code snippet:
In HTML:
In Controller:
It waits to read the whole file content from S3. But the it doesn't return video to html. If I tried to show the S3 image, it read the whole image content from S3 and return to the html successfully.
I can't stream the video/Image while downloading in progress.
The text was updated successfully, but these errors were encountered: