<commit_before>import QtQuick 1.0
import AbstractMediaPlayer 1.0

QMHMediaBackend {
//    property variant source

    //state
//    property variant playing
//    property variant hasAudio
//    property variant hasVideo
//    property variant volume
//    property variant position
//    property variant seekable
//    property variant status
//    property variant paused
//    property variant playbackRate
    playing: false
    hasAudio: true
    hasVideo: false
    volume: 0.5
    position: 0
    seekable: true
    status: AbstractMediaPlayer.NoMedia
    paused: false
    playbackRate: 1.0


    onSourceChanged: {
        runtime.mediaPlayer.source = source
        //Benefit of the doubt!
        status = AbstractMediaPlayer.Buffered
        hasAudio = true
        playing = true
    }

    onPausedChanged:
        //Why are these discrete functions again girish?
        if (paused)
            runtime.mediaPlayer.pause()
        else
            runtime.mediaPlayer.resume()

    //Having a hard time deciding what to maintain
    //As (setable) property and what to keep as function
    function play() { runtime.mediaPlayer.play() }
    function stop() { runtime.mediaPlayer.stop() }
}<commit_msg>Add bindings for hasVideo and statusChanged<commit_after>import QtQuick 1.0
import AbstractMediaPlayer 1.0
import QtMediaHub.components 1.0

QMHMediaBackend {
    id: root
//    property variant source

    //state
//    property variant playing
//    property variant hasAudio
//    property variant hasVideo
//    property variant volume
//    property variant position
//    property variant seekable
//    property variant status
//    property variant paused
//    property variant playbackRate
    playing: false
    hasAudio: true
    hasVideo: false
    volume: 0.5
    position: 0
    seekable: true
    status: AbstractMediaPlayer.NoMedia
    paused: false
    playbackRate: 1.0

    onSourceChanged: {
        runtime.mediaPlayer.source = source
        //Benefit of the doubt!
        status = AbstractMediaPlayer.Buffered
        hasAudio = true
        playing = true
    }

    onPausedChanged:
        //Why are these discrete functions again girish?
        if (paused)
            runtime.mediaPlayer.pause()
        else
            runtime.mediaPlayer.resume()

    //Having a hard time deciding what to maintain
    //As (setable) property and what to keep as function
    function play() { runtime.mediaPlayer.play() }
    function stop() { runtime.mediaPlayer.stop() }

    QMHUtil {
       id: util
    }

    Component.onCompleted: {
        util.createBinding("root", "hasVideo", "runtime.mediaPlayer.hasVideo", root)
        util.createBinding("root", "status", "runtime.mediaPlayer.status", root)
    }
}
{'fraction_non_alphanumeric': 0.07927272727272727, 'fraction_numerical': 0.007272727272727273, 'mean_word_length': 2.4047029702970297, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5324284', 'n_tokens_mistral': 748, 'n_tokens_neox': 718, 'n_words': 232}