7 Replies Latest reply on Feb 13, 2015 6:43 AM by Jon Tara

    Is it possible to do videocapture with Rhodes 5.0.25 ?

    Thierry Leloup

      Hello everybody,


      We are evaluating Rhodes 5.0.25 for an application we want to develop and we really need video capture. Perfect solution should be to have the getUsermedia support so that we could do both video/audio captures and WebRTC.

      It seems Rhodes is able to do videocapture according to Rhomobile CEO : "Rhodes 2.0 Brings HD Audio-Video Streaming" (Rhodes 2.0 Brings HD Audio-Video Streaming, Is Now Free Under MIT License).

      When I look to the Rhodes documentation(Rhomobile | RhoMobile API Summary), I found a "videocapture" API to be used in Ruby only :Capture d’écran 2015-02-03 à 10.25.45.png

      but none of the Platforms columns are checked ?! what does that mean ? is it really usable ?

      I also found this : Rhomobile | Videocapture and tried it out but I am facing an issue when trying to test the very simple example from the documentation (Rhomobile | Videocapture) : "Error: uninitialized constant Rho::Videocapture" ???


      Eventhough this should work, what about the "Audio-Video stremaing" Rhomobile CEO was talking about ?

      I know, this is a lot of questions here but I am confused and still don't know if Rhodes is really the tool we need for our application..

      Thanks for your help,


        • Re: Is it possible to do videocapture with Rhodes 5.0.25 ?
          Jon Tara

          If I am reading the API matrix correctly, VideoCapture is available only in Windows Mobile, and requires a paid RhoElements license.


          You can implement anything that the underlying system's APIs are capable of by writing a native extension, though. You will have to write it for each platform you want to support. I would do searches to see if somebody else has already done so.


          Depending on what you are trying to accomplish, either a Native Extension, a Native UI Extension, or both, might be appropriate.


          The article you reference is very old. Rhodes 2.0 is a long time ago. I'd guess priorities changed since then.


          I don't know if getUserMedia() works in a UIWebView (iOS) or WebView (Android). If it does, though, then you may not need any specific Rhodes support to use it.


          Capturing Audio & Video in HTML5 - HTML5 Rocks


          Try this to test for some amount of support:


          function hasGetUserMedia() {
          return !!(navigator.getUserMedia || navigator.webkitGetUserMedia ||
          .mozGetUserMedia || navigator.msGetUserMedia);

            • Re: Is it possible to do videocapture with Rhodes 5.0.25 ?
              Thierry Leloup

              I already tried getUserMedia but it does not work neither on iOs nor Android with Rhodes ...


              Thanks anyway.


              And a last comment on the documentation (Rhomobile | Videocapture) : several comments seem to indicate this API is working on both iOs and Android, ex :

              start(CallBackHandler callback)

              Starts capturing video until either ‘stop’ is received, or ‘duration’ is reached.

              On Android this meta tag wouldn’t immediately start recording and presents a preview window with controls (start, stop and cancel) for recording.
                • Re: Is it possible to do videocapture with Rhodes 5.0.25 ?
                  Jon Tara

                  The documentation seems wrong on platform implementation. I just searched branch 5-0-sp2-stable source (which should correspond to 5.0.25) and I see it appears implemented for Android, iPhone, and WM platforms. It is also present in current master branch (post-5.0.25 work-in-progress).


                  It is an extension. Did you include the videocapture extension in your list of extensions in build.yml? There are separate audiocapture and videocapture extensions.

                  • Re: Is it possible to do videocapture with Rhodes 5.0.25 ?
                    Jon Tara

                    The documentation seems a bit off on this:


                    - The API matrix shows an * indicating that it is an old 2.2 API that hasn't yet been re-written as a 4.x+ API. But it does seem implemented as a 4.x API.


                    - the left-hand documentation navigator leads to the documentation for the old, deprecated API. I don't know if this is still supported. (Edit: actually, it looks like old RhoElements documentation? Strange HTML <meta>s that I'm afraid I do not recognize and do not use.)


                    - But the matrix does lead to current documentation:


                        Rhomobile | Videocapture


                    - But that documentation seems to give the wrong extension name. It's listed in the documentation as "mediacapture". Examination of the source code reveals it is "videocapture".


                    Try adding the videocapture extension to your build.yml and follow the API documentation give in the link I referenced just above. Note that you will get an error if you try to load a non-existent extension, so I think you should also remove mediacapture from extensions, but I am not completely sure about that. I'm not completely familiar with the filesystem layout of the built-in extensions. There may or may not be a media capture extension that you need to load along-with either audiocapture or videocapture.


                    Sorry, I haven't actually used this myself, only capture of photos.

                      • Re: Is it possible to do videocapture with Rhodes 5.0.25 ?
                        Thierry Leloup

                        I have tried this :


                        "videocapture" only in build.yml extensions:

                        Then, when running "rake clean:iphone", I got this message :

                        **** WARNING *************************************************************************************************

                           The following extensions do not have JavaScript API:


                           Use RMS 4.0 extensions to provide JavaScript API


                        and a call to Rho.Videocapture.start(videoCaptureCallBack); ends up with "'undefined' is not an object (evaluating 'Rho.Videocapture.start')

                        EDIT : also tried a Ruby call using the documentation example and it ended up with "Error : uninitialized Rho::VideoCapture"

                        "mediacapture" only in build.yml extensions :

                        a call to Rho.Videocapture.start(videoCaptureCallBack); ends up with "API module is not found"


                        "mediacapture" and "videocapture" : "API module is not found"



                        EDIT : I observed I got a Rhodes lib directory named /Users/thierry/.rvm/gems/ruby-2.1.5/gems/rhodes-5.0.25/lib/extensions/videocapture/ext/videocapture/platform which contains 3 subdirectories : android, iphone and wm...

                        I took a look into android one and there some very small .java and .ccp files ?!


                        And also /Users/thierry/.rvm/gems/ruby-2.1.5/gems/rhodes-5.0.25/lib/commonAPI/mediacapture/ext/platform/android/src/com/motorolasolutions/rho/videocapture/ which contains a lot of .java files ?!


                        It seems to me the videocapture/mediacapture extension is supported but the question is "how to use it" ?

                          • Re: Is it possible to do videocapture with Rhodes 5.0.25 ?
                            Thierry Leloup

                            Any idea of how to use video capture with Rhodes 5.0.25 which seems to be supported ?


                            This is a really important function for us and we still don't know how to use it. We could develop our own native drivers but it should be a big work that could be unnecessary if it is already available in Rhodes API...




                              • Re: Is it possible to do videocapture with Rhodes 5.0.25 ?
                                Jon Tara

                                The warning message above indicates that you've successfully loaded the videocapture API. But it also indicates that the videocapture API is not implemented for Javascript.


                                You MUST use Ruby for videocapture, at least with current version. As I understand it, all NEW APIs will come with a Javascript implementation as well. videocapture hasn't been re-written yet.


                                To use a Javascript API, there is some additional JS to load. But not if the Javascript API doesn't even exist!


                                In general, you will have less trouble and better performance with Rhodes if you use Ruby.