bombbomb / BBCore

A Javascript API to use BombBomb services
4 stars 12 forks source link

No video urls passed to callback for saveRecordedVideo on mobile #16

Open DubHunt opened 7 years ago

DubHunt commented 7 years ago

So, we've noticed that the argument passed to the callback we provide to saveRecordedVideo does not contain any usable video_urls or a short_url when the video is recorded on an Android phone or iPhone even though success is indicated. Is this a known issue?

Here is what is passed when using Chrome on a desktop:

{
    "status": "success",
    "methodName": "VideoRecordedLive",
    "info": {
        "id": "a6f504bf-607e-dc94-d282-6e2c6279217d",
        "copiedFromId": null,
        "status": "1",
        "user_id": "f1e3d689-8a75-b4d8-0fd8-ceded6413ec9",
        "name": "testing6",
        "description": " ",
        "alt_text": "Click to play video",
        "video_urls": {
            "H264Main": "https://s3.amazonaws.com/s3video.bombbomb.com/a6f504bf-607e-dc94-d282-6e2c6279217d_H264Main.mp4"
        },
        "animated": "1",
        "thumb_id": "a6f504bf-607e-dc94-d282-6e2c6279217d",
        "thumb_url": "https://s3.amazonaws.com/bbemail/PROD/video_thumbs/a6f504bf-607e-dc94-d282-6e2c6279217d.jpg?r=99266",
        "animated_thumb_url": "https://s3.amazonaws.com/bbemail/PROD/video_thumbs/a6f504bf-607e-dc94-d282-6e2c6279217d.gif?r=47436",
        "thumb_url_orig": "https://s3.amazonaws.com/bbemail/PROD/video_thumbs/a6f504bf-607e-dc94-d282-6e2c6279217d_orig.jpg?r=41752",
        "thumb_switch_url": "https://bbemaildelivery.com/bbext/?p=vid_thumb_switch&thumb_id=a6f504bf-607e-dc94-d282-6e2c6279217d",
        "usingCustomThumb": "0",
        "no_logo": "0",
        "short_url": "http://vid.us/4jmhbi",
        "play_button_pos": "bl",
        "height": "360",
        "width": "640",
        "duration": "1",
        "encoder_key": "VEP",
        "encoder": null,
        "encoding_media_id": null,
        "video_input_method": "live",
        "upload_date": "2017-04-13 17:20:37",
        "available_formats": ["H264Main", ""],
        "original_video_url": "http://ec2-54-175-201-86.compute-1.amazonaws.com:8088/{\"url\":\"https://s3.amazonaws.com/socket-scribe/a6f504bf-607e-dc94-d282-6e2c6279217d.2a704258-7d34-4430-8956-dbc06fadf1e7.mp4\",\"width\":640,\"height\":360,\"videoCodec\":\"h264\",\"audioCodec\":\"aac\",\"duration\":1}",
        "original_width": "640",
        "original_height": "360",
        "original_filename": "{\"url\":\"https://s3.amazonaws.com/socket-scribe/a6f504bf-607e-dc94-d282-6e2c6279217d.2a704258-7d34-4430-8956-dbc06fadf1e7.mp4\",\"width\":640,\"height\":360,\"videoCodec\":\"h264\",\"audioCodec\":\"aac\",\"duration\":1}",
        "original_filesize": "",
        "original_video_codec": "h264",
        "original_audio_codec": "aac",
        "cdn_video_id": "",
        "view_count": null,
        "heatmap_totals": null,
        "heatmap_gen_date": null,
        "heatmap_do_not_proc": "0",
        "encoding_retry_attempts": "0",
        "encoding_cost": null,
        "hosting_partner": "S3",
        "userFirstName": "redacted",
        "userLastName": "redacted",
        "userEmailAddress": "redacted@redacted.net",
        "clientName": "redacted",
        "remote_id": null
    }
}

And here is the what is passed when video is recorded on a Nexus 5X Android 7.1.2 Chrome 57.0.2987.132

{
    "status": "success",
    "methodName": "VideoRecordedLive",
    "info": {
        "id": "1d293beb-598c-1523-0795-c2e888477da1",
        "copiedFromId": null,
        "status": "0",
        "user_id": "f1e3d689-8a75-b4d8-0fd8-ceded6413ec9",
        "name": "Ok",
        "description": " ",
        "alt_text": "Click to play video",
        "video_urls": [],
        "animated": "0",
        "thumb_id": "1d293beb-598c-1523-0795-c2e888477da1",
        "thumb_url": "https://s3.amazonaws.com/bbemail/PROD/video_thumbs/1d293beb-598c-1523-0795-c2e888477da1.jpg?r=68204",
        "animated_thumb_url": "",
        "thumb_url_orig": "https://s3.amazonaws.com/bbemail/PROD/video_thumbs/1d293beb-598c-1523-0795-c2e888477da1_orig.jpg?r=28530",
        "thumb_switch_url": "https://bbemaildelivery.com/bbext/?p=vid_thumb_switch&thumb_id=1d293beb-598c-1523-0795-c2e888477da1",
        "usingCustomThumb": "0",
        "no_logo": "0",
        "short_url": null,
        "play_button_pos": "bl",
        "height": "576",
        "width": "324",
        "duration": "2.432",
        "encoder_key": "VEP",
        "encoder": null,
        "encoding_media_id": null,
        "video_input_method": "live",
        "upload_date": "2017-04-13 17:08:09",
        "available_formats": [""],
        "original_video_url": "http://ec2-54-221-50-89.compute-1.amazonaws.com:8088/https://s3.amazonaws.com/bb-video-uploads/810d3b6b-4c5b-4391-b13d-f22be3862040.mp4",
        "original_width": "1080",
        "original_height": "1920",
        "original_filename": "https://s3.amazonaws.com/bb-video-uploads/810d3b6b-4c5b-4391-b13d-f22be3862040.mp4",
        "original_filesize": "",
        "original_video_codec": "h264",
        "original_audio_codec": "aac",
        "cdn_video_id": "",
        "view_count": null,
        "heatmap_totals": null,
        "heatmap_gen_date": null,
        "heatmap_do_not_proc": "0",
        "encoding_retry_attempts": "0",
        "encoding_cost": null,
        "hosting_partner": "S3",
        "userFirstName": "redacted",
        "userLastName": "redacted",
        "userEmailAddress": "redacted@redacted.net",
        "clientName": "redacted",
        "remote_id": null
    }
}

Let me know if there is any more info you need. Thanks.

perl5punk commented 7 years ago

At first glace I see 'status' is reporting 0 (not ready) in the Android result. We have seen that it can take longer for Android videos to be processed completely, but usually not much. Do you know if the status eventually returns 1 (ready)?

DubHunt commented 7 years ago

I don't know for certain, but the video does later appear in my library, so I assume so. I didn't notice the status. I assumed that the callback would be invoked when the video was ready and available. Does this mean I'm going to have to handle that case in the success callback and poll until status is 1?

perl5punk commented 7 years ago

Typically the video will be ready immediately, however, in the case the status does not come back as Ready (1), it's best to fallback to polling, for which there is a getVideoStatus method (which seems to not be documented). We are looking into this issue although will likely be next week until we have anything further.

DubHunt commented 7 years ago

Gotcha. Thanks for the responses.