Skip to content
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

JavaScript exception while uploading video after recording in Cordova app #34

Closed
sagrawal31 opened this issue Feb 20, 2020 · 16 comments
Closed

Comments

@sagrawal31
Copy link

Error Description

I'm trying to run the sample Cordova app https://github.com/Ziggeo/cordova-ziggeo-demo. After setup & preparation, when I started recording the video, it worked. But when I pressed "Ok" (which starts uploading to the server), a JavaScript exception is being thrown:

TypeError: Cannot read property '0' of undefined
    at o._upload (ziggeo.js:formatted:7438)
    at o.__upload (ziggeo.js:formatted:7384)
    at o.upload (ziggeo.js:formatted:7379)
    at t._uploadVideoFile (ziggeo.js:formatted:27949)
    at t.<anonymous> (ziggeo.js:formatted:26804)
    at Promise.triggerResult (ziggeo.js:formatted:2541)
    at Promise.triggerResult (ziggeo.js:formatted:2546)
    at Promise.asyncSuccess (ziggeo.js:formatted:2571)
    at Promise.<anonymous> (ziggeo.js:formatted:2610)
    at Promise.triggerResult (ziggeo.js:formatted:2541)

The exception is being thrown at the following line when trying to read this._options.source.files[0]:

image

I thought this might be because of the old versions of cordova-plugin-file and cordova-plugin-media-capture so I upgraded everything to the latest version but I'm facing the same issue.

Environment

  • OS: macOS Catalina
  • Cordova CLI: 9.00 (cordova-lib@9.0.1)
  • Android version: 9 (Samsung One UI 1.0)
  • cordova-android: 8.1.0
  • cordova-plugin-android-permissions: 1.0.0
  • cordova-plugin-camera: 4.1.0
  • cordova-plugin-file: 6.0.2
  • cordova-plugin-media-capture: 3.0.3
  • ziggeo-client-sdk: 2.35.4
@sagrawal31
Copy link
Author

I tried to debug the this._options object as well:

image

@sagrawal31
Copy link
Author

Expecting at least an acknowledgement from the Award-winning API team.

@Bane-D
Copy link
Contributor

Bane-D commented Feb 22, 2020

Hi Shashank,

Thank you for getting in touch and letting us know about this.

Seeing how you have 2 tickets open on our system for this issue, we saw it as if you already got initial reply and follow ups from there, so replying here with same details would not add any benefit.

By replying to all places where you posted about this (tickets, SO post and here) it would just lead to confusion as possibly different details get shared in different places.

Once sorted out we would update you here as well just to be able to help anyone else coming to this issue.

If you prefer, we can close the tickets and just keep communication through this issue alone? If that is your preference please let us know and we will close those tickets.

Regards,
Bane

@sagrawal31
Copy link
Author

sagrawal31 commented Feb 22, 2020

Hi @Bane-D thank you for the reply. I apologies for the mess about multiple tickets and replying here and there.

But please understand my position. Going through the site https://ziggeo.com/ and all the integrations, I was considering the integration will be a cake-walk and I postponed the integration testing by 3 days (in order to complete the other part of our mobile app).

But when I started to integrate the Ziggeo recorder, I found out that it is broken and I couldn't do anything about it. Although, I did my best to raise a support ticket (apparently 2 tickets) by doing all possible ways of debugging and research so I was expecting that Ziggeo (which is so popular & used by some world leaders and also have an award-winning API) team would reply within a day but I was so shocked to see that the replies are so delayed and our business planning is all messed up because of a few bugs/issue in the library itself.

I had no choices left except trying to connect with you guys to get a quick workaround.

we saw it as if you already got initial reply and follow ups from there

Yes, I got an initial reply from one of your team members but I didn't get a follow-up reply when I asked for an estimated fix/workaround/solution.

And that is my concern @Bane-D because I can't convey anything with a solid plan to our business team about the release of the app which is only blocked because of this issue.

I hope you are getting my concern. Please feel free to revert back.

If you prefer, we can close the tickets and just keep communication through this issue alone

No, please leave this issue open. I agree with your thoughts that it will be able to help anyone else coming to this issue.

Thank you,
Shashank

@Bane-D
Copy link
Contributor

Bane-D commented Feb 22, 2020

Hi Shashank,

We do understand how some feature not working can delay things. To the best of our knowledge the Cordova integration has been working and we did not hear back about any issues.

We have a large number of SDKs that we provide and maintain however as any project, we depend on other scripts we utilize to be without any issues. While we do have automated tests in place, it is impossible to know and test things fully every time some change happens across our dependencies and their dependencies.

For this reason unless we change things on our end, we might not detect some possible issue until reported so we are always happy hearing that things work as well as if there is something we can further improve.

We look to provide demos for our over 20 SDKs that we have built and maintain. This allows everyone to quickly get a POC up and running. From there we usually get questions about how some specific usecase/workflow can be done, or if some direct or deep dependency is changed to make things not work as expected (as in your case) when we get a report.

Seeing how this was reported at the end of week it means not all of our members are as available as they would otherwise be. Either final fixes or improvements are expected to be pushed out or they are away for weekend. With that said, this has already been assigned to our teammate that has experience with Cordova to look into and address it.

We can not provide you any ETA for this at this time. I do not believe it will take long however we do not like giving numbers unless we are certain in them. On Monday we should have a bit more details available. Either the update that is fixed, or ETA for the same.

PS: I have asked my colleagues to have this as the main place for all replies going forward so that it is easy to follow up and help you reach a quick resolution.

Thank you for your understanding,
Bane

@sagrawal31
Copy link
Author

Hi @Bane-D

Thank you again for the follow-up & reply.

it is impossible to know and test things fully every time some change happens across our dependencies

Yes, I totally agree with you.

On Monday we should have a bit more details available. Either the update that is fixed, or ETA for the same.

Thank you for a rough time. I'll count on this :) I appreciate this.

PS: I have asked my colleagues to have this as the main place for all replies going forward so that it is easy to follow up and help you reach a quick resolution.

Got your point on this.

Thank you,
Shashank

@Bane-D
Copy link
Contributor

Bane-D commented Feb 24, 2020

Hi Shashank,

As promised I am following up today.

We do have a bit more details in regards to the issue. Unfortunately this is behaving differently across several different versions of different dependencies.

Our developers are looking into this and based on their report the ETA for the solution that will make it work for different versions (of some dependencies) is by the end of the week.

As soon as there is a version that you can test, we will make it available to make sure it works on your setup as well.

Regards,
Bane

@sagrawal31
Copy link
Author

Hi @Bane-D

Thank you for keeping your promise and the follow-up.

I do understand the scenario of certain feature/part of the code behaving differently on different environment and platform.

But since I have already explained you our position to need a fix for this, can't you guys release at least a patch version (by today or tomorrow) which fixes it for the latest version of the libraries (like I have mentioned) so that at least the original reporter of the issue (i.e. us 😀) can get going and then you guys take the week to fix the issue for all the different environment?

Or at least give us a workaround by today so that we can at least push our app for UAT?

Please reconsider your timelines based on the above points.

Thank you again,
Shashank

@Bane-D
Copy link
Contributor

Bane-D commented Feb 25, 2020

Hi Shashank,

Makes sense. Now our goal is to always push out the updates that pass our backwards tests. Any update we make should not break the setup of someone that has decided to update to a newer version.

We have the uploading and uploading of the recording working right in Cordova, however we have to make sure that it is working right for everyone that decide to update. Especially since in this case it is not just Cordova apps update.

The update that resolves this is in our JS SDK so it means that all SDKs that depend on it (like this client sdk) need to be checked so that nothing else gets broken in any way or form.

This is why we estimated end of the week. Of course, if everything checks out by tomorrow we will push the updates to all involved SDKs right away :)

With that said, we also look to help out when possible with specific updates, so our developers already created a file that you could test with and which should work for your case.

You will find attached "ziggeo.zip" file. Please download it and then extract and place ziggeo.js file over the one that gets compiled in www/assets folder

ziggeo.zip

  • You will need to do this manually at this time until we push the update that would allow you to just compile your app without using this file.

Regards,
Bane

@sagrawal31
Copy link
Author

Hi @Bane-D

Thank you for the constant followup and updates. It's really a relief and I'm confident that you guys will push something very soon.

The update that resolves this is in our JS SDK so it means that all SDKs that depend on it (like this client sdk) need to be checked so that nothing else gets broken in any way or form.

Totally, agreed!

Please download it and then extract and place ziggeo.js file over the one that gets compiled in www/assets folder

Thank you very much of this additional support, @Bane-D. I really appreciate this work. I'll get it tested right away and will update you soon.

Thanks again,
Shashank

@sagrawal31
Copy link
Author

Seeing your message @Bane-D at 1:30 in the night, I woke up from the bed and tested with the zip file you provided and I can't express my feelings that it worked like I charm 🤩🎉🎊

Really really appreciate your team effort @Bane-D and thank you so much for this.

At least now, we can finish our app development with this modified ziggeo.js file and then once you guys release the final version, we'll switch back to the dependency.

Thanks again!!!!!

Great job!

@sagrawal31
Copy link
Author

@Bane-D not sure, if I should create a new ticket for this but this is happening from before as well but seems like most of the embedding parameters are not working. For example, I don't want the manual upload video option so I tried manualsubmit/allowcustomupload option in both the ways:

<ziggeorecorder ziggeo-width=320 ziggeo-height=240 ziggeo-theme="modern"
               ziggeo-themecolor="blue" ziggeo-timelimit="120"
               ziggeo-allowcustomupload="false" ziggeo-manualsubmit="false"
               ziggeo-allowcancel="false" ziggeo-autorecord="true"
               ziggeo-localplayback="false"></ziggeorecorder>

or

window.ziggeoApplication = new ZiggeoApi.V2.Application({
    token: "my-token"
});

ziggeoApplication.on("ready", function () {

    var recorder = new ZiggeoApi.V2.Recorder({
        element: document.getElementById("recorder-hoo"),
        attrs: {
            width: 320,
            height: 240,
            theme: "modern",
            themecolor: 'blue',
            localplayback: false,
            allowcustomupload: false,
            manualsubmit: false,
            allowcancel: false,
            autorecord: true,
        }
    });

    recorder.activate();
});

But I can still see the manual "Upload Video" link below the "Record Video" button. Do you see this as an issue or am I missing something?

Some other questions:

  1. We don't want to have the confirmation screen (i.e. Retry & Ok buttons) after recording the video. I was considering that this can be turned off by localplayback option but it's not working.
  2. We want to auto-start the recording and auto-submit the video post recording, but that too is not working. I'm assuming it should be controlled by autorecord & manualsubmit option.
  3. We don't want to show the player after video processing is done. But couldn't find a way.

Please let me know if we need to discuss this in a different way.

@Bane-D
Copy link
Contributor

Bane-D commented Feb 25, 2020

Awesome glad to hear that it is working for you Shashank :)

Will pass your message to everyone in the team and we will update you here once everything is updated so that the Cordova works just fine with our updates in our JavaScript SDK.

In regards to new comment, I would like to ask you if you can send us an email to support@ziggeo.com. Quickly looking at the codes, what you mentioned and what you are after, it does not look like an issue, rather explaining some parameters and suggesting few things. We would be happy to help you in the tickets with the same :)

  • It would also help anyone else looking for this specific issue with Cordova.

Regards,
Bane

@sagrawal31
Copy link
Author

Thank you @Bane-D for a satisfactory reply on the usage of parameters. I have sent an email to the support address. Will discuss there and also keep you updated.

Thank you,
Shashank

@Bane-D
Copy link
Contributor

Bane-D commented Feb 26, 2020

Awesome :)

Just wanted to update you and anyone looking into this that we have made the update available so using standard compile for Cordova will work just fine. So from now on, it is no longer need to use the file we sent above.

Thank you again Shashank for reporting this and best of wishes to your launch. :)

Regards,
Bane

@Bane-D Bane-D closed this as completed Feb 26, 2020
@sagrawal31
Copy link
Author

Thank you @Bane-D for providing the fix and releasing it. We'll use the release. I saw the changes in the commit 4833924. Also, looks like the release was not updated in the Version History page.

best of wishes to your launch. :)

Thanks 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants