-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How do I get response header stream-media-id #59
Comments
This is not easily possible right now. One workaround is to subclass TusClient and overwrite the prepareConnection method to store a list of the HttpUrlConnections that tus-java-client makes: https://github.com/tus/tus-java-client/blob/master/src/main/java/io/tus/java/client/TusClient.java#L319 Hope that makes sense! |
Same requirement +1 |
Thanks for letting us know, @fujohnwang. Please use the workaround from above for now. |
Thanks for the advice. For the time being, I extract media id from returned URL(although it's not a recommended way as cloudflare docs says) 🤣 |
You can overidae prepareConnection method in TusClient.class. example: public class TusClientDemo extends TusClient{
private HttpURLConnection connection;
@Override
public void prepareConnection(@NotNull HttpURLConnection connection) {
super.prepareConnection(connection);
this.connection = connection;
}
public HttpURLConnection getConnection() {
return connection;
}
public void setConnection(HttpURLConnection connection) {
this.connection = connection;
}
} you can calling prepareConnection by TusClientDemo TusClientDemo client = new TusClientDemo();
...
String streamId = client.getConnection().getHeaderField("stream-media-id"); |
Thank you for your example, @lv2023100! We will implement a better way to access headers in the next major release: #78 |
I'm using cloudflare stream tus, but its video id set "stream-media-id" in response header.
How do I get response header stream-media-id??
https://developers.cloudflare.com/stream/uploading-videos/upload-video-file/#resumable-uploads-with-tus-for-large-files
The text was updated successfully, but these errors were encountered: