-
Notifications
You must be signed in to change notification settings - Fork 49
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
Add support for large video file uploads (tus.io) #46
Conversation
…support System.Threading.Tasks
- Created `VimeoUploader` class - Created `VideoChunk` class to represent chunks of binary video data - Tested the `Tus.io` api upload mechanisem (commented out in the `VimeoApi`)
…e inspector 🙃 Plus formatting the changed files
`VimepUploader.cs` should be `VimeoUploader.cs`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, left feedback!
…ad of storing a reference to it 🙌
…en created instead of at the end of an upload This resolved situation where an error in upload makes the video uploaded "Untitled" and public
- Setting up the video (privacy/name/review page) at the begining of the upload - Implementing VimeoUplader as a derived class from the VimeoApi base class - Implementing events (OnUpload...) - Fixing typos (e.g progress in VimeoUploader) - Cleaning up whitespaces and comments - Fixing misc PR comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall it's looking great! 🎉
Since we now have a real test suite, there is still one major todo here. You wrote two new classes: VimeoUploader
and VideoChunk
, both of which should come with unit tests.
Also one other thing we should do is hide all the Vimeo config settings while recording/uploading since it is all set in the beginning now.
r.SetRequestHeader("Accept", "application/vnd.vimeo.*+json;version=" + apiVersion); | ||
} | ||
|
||
public static bool IsNetworkError(UnityWebRequest req) { | ||
protected void TriggerDerivedOnProgress(string status, float progress) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does TriggerDerived
mean? is that a tus term?
…on single chunk uploads
…ferent chunk sizes
…nks even after upload
@@ -18,6 +18,12 @@ public class VimeoRecorder : RecorderSettings | |||
public bool isRecording = false; | |||
public bool isUploading = false; | |||
public float uploadProgress = 0; | |||
private int m_customByteChunkSize = 1024 * 1024 * 128; | |||
public int customByteChunkSize { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not just call this byteChunkSize
?
|
||
private bool HasChunksLeftToUpload() | ||
{ | ||
if (currentChunkIndex < m_chunks.Count) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a more future proof way of checking would be to create a method called GetTotalRemainingChunks
which loops through to check status. e.g.
private bool HasPendingChunksToUpload()
{
return GetTotalRemainingChunks() == 0;
}
…ing error better
…ld be tested sepratly for large uploads
…into tus-upload
… in the build process on older versions of Unity (i.e Unity 2017)
…s well as the video itself inside the Tests folder
Why?
What was done?
VimeoUploader
andVideoChunk
to support the Vimeo tus.io upload APIVimeoUploader
extendsVimeoApi
to avoid repetition and code duplication[Timeout(ms)]
Future
VimeoPublisher
and dry it up withVimeoUploader
since they are both kind of doing the same thing. Also need to giveVimeoVideo
more responsibility which will help untangle code.Tested against the following versions
2018.2.13f1
,2018.2.9f1
,2018.2.6f1
,2018.2.4f1
,2018.2.1f1
,2018.1.6f1
,2017.1.5f1
,2017.1.4f1
For local development
If you are working off of
master
and not the latest release, you will need to delete theAssets/Tests
folder and assemblies before building an executable. Our releases will not ship with these files.