Created
October 2, 2020 17:43
-
-
Save zonble/529bca870b3870762924a1643c40b91a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let response = GCDWebServerStreamedResponse(contentType: "video/mp4", asyncStreamBlock: { block in | |
let begin = request.hasByteRaange ? request.byteRange.lowerBound : 0 | |
let end = request.hasByteRaange ? request.byteRange.higherBound : clipFileSize | |
var readHead = begin | |
while readHead < end { | |
let data = getData(readHead, chunkSize) | |
block(data, nil) | |
readHead += data.count | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment