MediaPlayer on Android, black screen



  • I want to run the video from the USB flash drive. I use xiaomi mi laser projector with android 5. Audio is fine, but the screen remains black. The same code on mibox 3 is working. I do not know what the error is. Google do not help.

    This is my code:

    import QtQuick 2.9
    import QtQuick.Controls 2.2
    import QtMultimedia 5.9
    
    Rectangle {
        property int index: 0
        property int count: 0
        property var playlist
    
        function init() {
            advPlayerSheduleModel.init()
        }
    
        AdvPlayerSheduleModel {
            id: advPlayerSheduleModel
    
            onUpdate: {
                playlist = newPlaylist;
                mediaplayer.stop()
                mediaplayer.play()
            }
        }
    
        MediaPlayer {
            id: mediaplayer
            autoPlay: true
            playlist: Playlist {
                playbackMode: Playlist.Loop
            }
    
            onStopped:
                goToNextMedia();
        }
    
        VideoOutput{
            id: videoItem
            anchors.fill: rect
            source: mediaplayer
        }
    
        function goToNextMedia(){
            count++;
            index++;
            index = index >= playlist.length ? 0 : index
    
            mediaplayer.source = playlist[index]
            mediaplayer.play()
        }
    }
    

    Log:

    06-10 20:14:30.061 13110 13141 D KLDBar  : qrc:/AdvPlayerShedule.qml:34 (onUpdate): qml: changePlaylist file:///storage/1A43-C170/Android/data/org.qtproject.example/files/Documents/11_286280112.mp4,file:///storage/1A43-C170/Android/data/org.qtproject.example/files/Documents/12_74381360.mp4,file:///storage/1A43-C170/Android/data/org.qtproject.example/files/Documents/14_212859275.mp4
    06-10 20:14:30.101 13110 13124 W MediaPlayer: info/warning (701, 0)
    06-10 20:14:30.411 13110 13110 E MediaPlayer: Unknown message type 10000
    06-10 20:14:30.412 13110 13110 D MediaPlayer: setSubtitleAnchor in MediaPlayer
    06-10 20:14:30.453 13110 13354 W MediaPlayer: info/warning (3, 0)
    06-10 20:14:30.456 13110 13354 W MediaPlayer: info/warning (702, 100)
    06-10 20:14:31.412 13110 13354 W MediaPlayer: info/warning (901, 0)
    06-10 20:14:33.224 13110 13131 D mali_winsys: EGLint new_window_surface(egl_winsys_display*, void*, EGLSurface, EGLConfig, egl_winsys_surface**, egl_color_buffer_format*, EGLBoolean) returns 0x3000
    06-10 20:14:36.723 13110 13131 D mali_winsys: EGLint new_window_surface(egl_winsys_display*, void*, EGLSurface, EGLConfig, egl_winsys_surface**, egl_color_buffer_format*, EGLBoolean) returns 0x3000
    06-10 20:14:38.962 13110 13110 D AudioManager: preDispatchKeyEvent 4
    06-10 20:14:39.081 13110 13110 D AudioManager: preDispatchKeyEvent 4
    06-10 20:14:39.099 13110 13354 E BufferQueueProducer: [SurfaceTexture-0-13110-0] cancelBuffer: slot 1 is not owned by the producer (state = 0)
    06-10 20:14:39.101 13110 13123 E BufferQueueProducer: [SurfaceTexture-0-13110-0] requestBuffer: BufferQueue has been abandoned
    06-10 20:14:39.102 13110 13354 E BufferQueueProducer: [SurfaceTexture-0-13110-0] cancelBuffer: BufferQueue has been abandoned
    06-10 20:14:39.102 13110 13123 E BufferQueueProducer: [SurfaceTexture-0-13110-0] cancelBuffer: BufferQueue has been abandoned
    06-10 20:14:39.103 13110 13354 E BufferQueueProducer: [SurfaceTexture-0-13110-0] dequeueBuffer: BufferQueue has been abandoned
    06-10 20:14:39.103 13110 13123 E BufferQueueProducer: [SurfaceTexture-0-13110-0] cancelBuffer: BufferQueue has been abandoned
    06-10 20:14:39.103 13110 13354 E BufferQueueProducer: [SurfaceTexture-0-13110-0] dequeueBuffer: BufferQueue has been abandoned
    06-10 20:14:39.160 13110 13404 E BufferQueueProducer: [SurfaceTexture-0-13110-0] cancelBuffer: BufferQueue has been abandoned
    06-10 20:14:39.160 13110 13404 E BufferQueueProducer: [SurfaceTexture-0-13110-0] cancelBuffer: BufferQueue has been abandoned
    06-10 20:14:39.160 13110 13404 E BufferQueueProducer: [SurfaceTexture-0-13110-0] cancelBuffer: BufferQueue has been abandoned
    
    


  • The problem was in the codecs.
    I replaced QtMultimedia with QtAV. Its work for me.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.