video of MMR and/or finished

Hey guys,.

I'm trying to understand how to know when a video is finished playing? I followed the tutorial for video playback in an opengles app, but it is not anything but the speed set and play. Through the header of multimedia renderer I couldn't see anything to help me with this either.

It is neccisary being able to have my game begins after a screen video spash. I prefer not just hard code video length and press timer to control the progression. It would be very stupid.

Also, is there a way to set the status in a video? It is less important, but I would like to have a beautiful red to C++ wrapper with common features (stop, pause, play, skip, etc.).

Thanks in advance!

Jared

Hi Jared!

mm-rendering engine publishes information that allows you to access this information.  You can use the API of bps to be notified of them, or of the PpsAccessor/PpsObject API (C++ or Cascades).  I recommend this approach... Sulman and I did a presentation on this topic at the BB10Jam in early may, the code is not yet, but will be very soon.  In the meantime, here's a very condensed version of what to do - not all this is documented, so I apologize if that's all it is 100% logical yet (I'm working hard to get it documented as soon as possible!):

// Subscribe to PPS notifications in 'delta' mode (i.e. only listen for changes)
    PpsObject ppsObject(QString("/pps/services/multimedia/renderer/context/%1/.all?wait,delta").arg(CONTEXT_NAME)));

// Open the Object for reading
    if (!ppsObject->open(bb::PpsObject::Subscribe)) {
        int errorCode = ppsObject->error();
        qDebug() << "Error: " << errorCode;
        return;
    }

// Create an accessor to be notified asynchronously (via 'dataRecieved') of new data
    PpsAccessor ppsAccessor(ppsObject.data()));
    QObject::connect(ppsAccessor.data(), SIGNAL(received(QVariantMap)), this, SLOT(dataReceived(QVariantMap)));

...

// MMRenderer tells us of new data:
void dataReceived(QVariantMap data) {

    // Print out what MMRenderer sends us, this let's us see what sort of things we can act on...
    qDebug() << "Data:" << data;

    if (data.contains("@metadata")) {
        // New track has been loaded, here's how we can access duration, title, artist, etc.
    }
    if (data.contains("@state")) {
        // MMRenderer is changing state to stopped, or playing, etc.
    }
    if (stateMap.contains("speed")) {
        // MMRenderer's speed has changed, if speed = 0 we are paused, if speed < 0 we are playing in reverse!  speed < 1 is slo-mo, 1 = normal speed, > 1 is fast-forward.
    }
    if (stateMap.contains("error")) {
        if (error == "0") {
            // This means we are at the end of playback... weird I know.
        } else {
            // ...otherwise a legitimate error occurred.  MMRenderer is already stopped automatically
        }
    }
    if (data.contains("@status")) {
        if (statusMap.contains("position")) {
            // This current playback position is sent approx. once per second, this is how you update a seek bar for example.
        }
    }
}

It's a little rough, but I hope you get the idea.  Print the map to see what kind of information that you can analyze.

Once again, the majority of this (good, probably all of this!) is not currently documented, but I'm working diligently to get this fixed as soon as possible!  Please be patient... in the meantime feel free to ask new questions as they come, and I will try my best to help with anything multimedia related!  I'm pretty busy these days so I can't guarantee a quick response, but others may be able to help as well.

BVP

Tags: BlackBerry Developers

Similar Questions

Maybe you are looking for

  • How can I stop stop in closing the laptop

    I just bought a laptop 053EA ENVY 17-J. I would use it in accordance with a projector. However when I close the lid of the computer goes into hibernation / standby. I would like to use it with the lid closed during presentations with the help of a ke

  • BIOS upgrade

    Hello with my HP250G3 I can not restart or shut down in linux OS, but in Windows works properly. Linux is not recognized BIOS, another user risolved this problem with the BIOS upgrade. You can write me a correct link? There is nothing on the support

  • Flex 2 14 WiFi issues

    I just bought a given product in nine official when I tried to use it but he quickly showed a problem with the WiFi connection. Is the WiFi card that bad that it can not detect a router since more than 4 meters? On my other laptop, I had to replace b

  • my cd drive just stop working, all the controls to say everything is fine, what can I do now

    It worked very well, and this week still the cd doesn't work do not, it acts like it is read, but then just stops

  • Need to download the link for the standalone installer KB982670.

    Please provide a link to download the file .msu to KB982670 .NET Framework 4 Client profile for Windows 7 x 64. This would save me a lot of hours of work and the trouble! Thank you.