×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 27
  1. #1
    Regular Contributor
    Join Date
    Mar 2011
    Posts
    111

    QML Video element on Harmattan

    Hi all,

    I have a simple test app:

    Code:
    import QtQuick 1.1
    import QtMultimediaKit 1.1
    import com.nokia.meego 1.0
    
    Window {
        id: mainWindow
    
        Rectangle {
            id:           backgroundRectangle
            anchors.fill: parent
            color:        "black"
    
            MouseArea {
                id:           mouseArea
                anchors.fill: parent
    
                Video {
                    id:           video
                    anchors.fill: parent
                    source:       "../video/look_around.mp4"
                    fillMode:     Video.PreserveAspectFit
                }
    
                onClicked: {
                    video.play();
                }
            }
        }
    }
    When I run this app on my N950 using Qt Creator (under developer account), this app works just fine - there is a video on the screen, when I press on it, it plays. So far so good. But when I try to run this app by pressing on N950 desktop icon, all I get is a black screen with no video. Tapping on MouseArea doesn't perform anything, still no video. I tried to run this app from user account via ssh (using devel-su user) to debug this strange behaviour, but no luck - if I run this app over ssh, it works just like as using Qt Creator. What should I do to be able to properly run this app by pressing on the desktop icon, or at least to get more information about problem (for example, grab some application output)?

    Thanks in advance.

  2. #2
    Regular Contributor
    Join Date
    Mar 2011
    Posts
    111

    Re: QML Video element on Harmattan

    Oh, false alarm. Just a typo in manifest.aegis

  3. #3
    Registered User
    Join Date
    Sep 2011
    Location
    Lebanon
    Posts
    59

    Re: QML Video element on Harmattan

    How did you solved the problem?
    Success is when you realize obstacles you face are challenges to help you become better - and your response equals the challenge.

  4. #4
    Nokia Developer Champion
    Join Date
    Jun 2008
    Location
    Noida,India
    Posts
    3,956

    Re: QML Video element on Harmattan

    Well did you specified the correct credentials in manifest.aegis file which are required to play a video?

  5. #5
    Registered User
    Join Date
    Sep 2011
    Location
    Lebanon
    Posts
    59

    Re: QML Video element on Harmattan

    the manifest file looks like this:

    <aegis>
    <request>
    <credential name="GRP::video" />
    <credential name="GRP:ulse-access" />
    </request>
    </aegis>
    Success is when you realize obstacles you face are challenges to help you become better - and your response equals the challenge.

  6. #6
    Registered User
    Join Date
    Sep 2011
    Location
    Lebanon
    Posts
    59

    Re: QML Video element on Harmattan

    I think the problem is with the path of the video because my qml files are within the resource file so I need to add that video to resource in order to reference it and as I conclude resource videos cannot be played
    Success is when you realize obstacles you face are challenges to help you become better - and your response equals the challenge.

  7. #7
    Nokia Developer Champion
    Join Date
    Jun 2008
    Location
    Noida,India
    Posts
    3,956

    Re: QML Video element on Harmattan

    Well you can add a folder in your project & put the video file inside that.Mention the folder path in the .Pro file as well

  8. #8
    Registered User
    Join Date
    Sep 2011
    Location
    Lebanon
    Posts
    59

    Re: QML Video element on Harmattan

    Ok I've added using:
    folder_01.source = qml/myapp/video
    folder_01.target = qml
    DEPLOYMENTFOLDERS = folder_01

    Then how to access it from the main qml file (qml/myapp/main.qml)?
    Success is when you realize obstacles you face are challenges to help you become better - and your response equals the challenge.

  9. #9
    Nokia Developer Champion
    Join Date
    Jun 2008
    Location
    Noida,India
    Posts
    3,956

    Re: QML Video element on Harmattan

    I think this should work:
    Video {

    ...
    ...
    ...
    source: "video/Videofile.mp4"

  10. #10
    Registered User
    Join Date
    Sep 2011
    Location
    Lebanon
    Posts
    59

    Re: QML Video element on Harmattan

    That is the problem it didn't work
    I also tried to type source:"/opt/myapp/qml/video/videoFile.mp4" and didn't work
    Success is when you realize obstacles you face are challenges to help you become better - and your response equals the challenge.

  11. #11
    Nokia Developer Champion
    Join Date
    Jun 2008
    Location
    Noida,India
    Posts
    3,956

    Re: QML Video element on Harmattan


  12. #12
    Registered User
    Join Date
    Sep 2011
    Location
    Lebanon
    Posts
    59

    Re: QML Video element on Harmattan

    If I check the source it always add qrc: before my path how to avoid this
    Success is when you realize obstacles you face are challenges to help you become better - and your response equals the challenge.

  13. #13
    Nokia Developer Champion
    Join Date
    Jun 2008
    Location
    Noida,India
    Posts
    3,956

    Re: QML Video element on Harmattan

    Well i think that is because your qml files are inside qrc folder, so giving any path inside qml will append the qrc thing.Why not keep the qml files simpy inside the qml folder, i mean if you see in the project folder then it would be inside qml/myapp

  14. #14
    Registered User
    Join Date
    Sep 2011
    Location
    Lebanon
    Posts
    59

    Re: QML Video element on Harmattan

    yes I know but in that case your source code is also deployed with the app (that should be published on ovi store) which is not needed.
    Now I can access the video through file://opt/myapp/qml/video/videoFile.mp4 but the video element load the file and stop at status = 2 and the video is not shown but the onStopped: function is called
    Success is when you realize obstacles you face are challenges to help you become better - and your response equals the challenge.

  15. #15
    Nokia Developer Champion
    Join Date
    Jun 2008
    Location
    Noida,India
    Posts
    3,956

    Re: QML Video element on Harmattan

    Did you changed the Main() according to what is given in post#11's link (adding QGLWidget ).Also are you playing the video on some event or as soon as the app is launched?

Page 1 of 2 12 LastLast

Similar Threads

  1. Audio Element worked bad on Harmattan.
    By rocjohn in forum Nokia N9
    Replies: 0
    Last Post: 2011-12-20, 04:50
  2. video streaming with Video element
    By FreeUser in forum [Archived] Qt Quick
    Replies: 13
    Last Post: 2011-07-19, 13:09
  3. Does QML Video element support seek feature?
    By xiaojun789 in forum [Archived] Qt Quick
    Replies: 10
    Last Post: 2011-07-04, 11:01
  4. QML QtMultimediaKit Video Element
    By Onddo in forum [Archived] Qt Mobility Project
    Replies: 0
    Last Post: 2010-12-23, 19:07

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •