PhantomAppDevelopment / pizza-app

An Adobe AIR mobile app that uses the Yelp Fusion & Firebase V3 API to create a small social network for pizza lovers.
https://play.google.com/store/apps/details?id=air.im.phantom.pizza
MIT License
15 stars 2 forks source link

upload video #12

Closed benkhachouch closed 7 years ago

benkhachouch commented 7 years ago

Please,

what changes i must do for upload a video in storage. what changes compared to image jpg; Thanks.

compared to

"now = new Date().getTime();

//We prepare the thumbnail for upload **var byteArray:ByteArray = new ByteArray();

var thumbBitmapData:BitmapData = scaleBMD(myBitmapData, "thumbnail"); thumbBitmapData.encode(new Rectangle(0, 0, thumbBitmapData.width, thumbBitmapData.height), new JPEGEncoderOptions(), byteArray);

var header:URLRequestHeader = new URLRequestHeader("Authorization", "Bearer " + _data.FirebaseAuthToken);

var request:URLRequest = new URLRequest(Constants.FIREBASE_STORAGE_URL + "images%2Fthumbs%2F" + String(now) + ".jpg"); request.method = URLRequestMethod.POST; request.data = byteArray; request.contentType = "image/jpeg"; request.requestHeaders.push(header);**

"

agentphantom commented 7 years ago

Sorry, I haven't worked with video yet, I'm unable to help you on this one.

But my guess is that you can convert the data from CameraUI to a bytearray and save it as .mp4

benkhachouch commented 7 years ago

it is the same discussion for uploading à file (zip,pdf..no image) l Know how create bytearray from file with filestream and .readbytes but i dont Know how make the request.

Le 20 avr. 2017 01:39, "Mr. Phantom" notifications@github.com a écrit :

Sorry, I haven't worked with video yet, I'm unable to help you on this one.

But my guess is that you can convert the data from CameraUI to a bytearray and save it as .mp4

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/PhantomAppDevelopment/pizza-app/issues/12#issuecomment-295494812, or mute the thread https://github.com/notifications/unsubscribe-auth/AMYpy0290_XosiAEhQSYxT39VScVY8AMks5rxpsfgaJpZM4NCQvk .

agentphantom commented 7 years ago

I recommend reading this part of the guide:

https://github.com/PhantomAppDevelopment/firebase-as3/tree/master/storage#uploading-a-file-with-auth

It shows you the minimum code to send a file to Firebase Storage. Once you have a bytearray it's super easy.

benkhachouch commented 7 years ago

Thanks very much!

Le 20 avr. 2017 02:05, "Mr. Phantom" notifications@github.com a écrit :

I recommend reading this part of the guide:

https://github.com/PhantomAppDevelopment/firebase-as3/tree/master/ storage#uploading-a-file-with-auth

It shows you the minimum code to send a file to Firebase Storage. Once you have a bytearray it's super easy.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/PhantomAppDevelopment/pizza-app/issues/12#issuecomment-295502745, or mute the thread https://github.com/notifications/unsubscribe-auth/AMYpyxMPmfUNK_0-1htdYND7SP-tqc8Lks5rxqFAgaJpZM4NCQvk .