Skip to content

Help is needed! #2

@doublefx

Description

@doublefx

Help is needed!

For the NetStream loader it doesn't have the optimal solution it first save the file to local >disc and then play. t will be perfect if it could buffer the stream and in end create file out of >it.

It is what I do in one of my demo project using Thread to download files concurrently.

I use an URLStream to download internet files and each 0.5s, I write in a FileStream what there's is in the content loader using a ByteArray buffer, even if the user pause and terminate the Thread and restart the download again, what I do is I restart the download from the cache, I check first the file size didn't change on the server, if it has changed (could happen), I start the download again but from scratch, to know if the size of the of file has changed on the server I use SQLite to store the info.

You can have a look at the Runnable (a bit the same than a Worker but managed by a Thread and created in-memory): https://github.com/doublefx/easyWorker/blob/master/moreFlexDemo/downloadFileThread-Demo/src/infrastructure/thread/impl/DownloadFileRunnable.as

I hope it will help you to achieve your goal but if you have any question about the implementation, just ask.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions