4 Replies Latest reply: Jul 22, 2014 2:46 PM by bbb_999 RSS

    How can I access HTTP services via Extendscript from PPro CC

    schallis-z Community Member

      I attempting to build an HTML5 panel for Premiere Pro that retrieves assets from a third party REST API but there seems to be no support for Socket or XMLHttpRequest objects in this application which there is for others. (I get Error: Socket does not have a constructor)

       

      How would I go about making these requests in Extendscript?

        • 1. Re: How can I access HTTP services via Extendscript from PPro CC
          kpradel Community Member

          When you are building panels using the Eclipse / Builder setup, you have access to jQuery (it's an option you can enable when you're building the app). However, Adobe seems to be following strict javascript cross-domain policies so your only option is to use jsonP which not every rest service provider implements.

           

          Hope this helps.

           

          Kai

          • 2. Re: How can I access HTTP services via Extendscript from PPro CC
            schallis-z Community Member

            Thank KaiPradel,

             

            I did try importing jQuery 1.9.1 but it was throwing an error when run in Premiere. And I would assume jQuery must use Socket, or XMLHttpRequest anyway so I'm not sure how that would work if they aren't supported in Premiere. The cross domain stuff is interesting though.

             

            I've actually got my panel successfully running and making requests in InDesign with a few tweaks so I assume Premiere support is just a little less mature.

            • 3. Re: How can I access HTTP services via Extendscript from PPro CC
              jingtaotan

              Hi schallis,

               

              I am also looking into using sockets (creating a socket server in Premiere) from my HTML5 panel, but am also getting "Socket is not defined" when running it in the context of Premiere.

               

              I think you are mixing up the Javascript engine that is in CEF (Chrome Embedded Framework, which runs the Javascript in your HTML panel), and CEP (Common Extensibility Framework, which runs JSX code). The Socket class in question belongs to the CEP side of things. so the lack of it in CEP doesn't mean that you can't use web sockets (if they were supported) in the CEF side.

               

              I am fairly certain jQuery doesn't do sockets, so it would be an XmlHttpRequest if using jQuery.

              • 4. Re: How can I access HTTP services via Extendscript from PPro CC
                bbb_999 Adobe Employee

                Since your panels were already in JavaScript before calling into ExtendScript, why not just do the web work from there, instead of from within ExtendScript? You can pass stuff from JavaScript --> ExtendScript, and back again, as needed...