如何创建表面以在Tizen原生应用中显示视频?

时间:2015-12-16 08:30:33

标签: tizen tizen-wearable-sdk tizen-native-app

我正在尝试为可穿戴设备开发一个tizen原生应用,用于显示存储在设备中的视频。我不知道如何使用Evas定义显示句柄。有人知道怎么做吗?

2 个答案:

答案 0 :(得分:0)

答案 1 :(得分:0)

Tizen可穿戴设备支持HTML5。以下是Tizen Documents中的播放和暂停示例。

Link => HTML5 video and audio element: Playing and Managing Multimedia Content

<div align="center">
    <h2>Custom Controls : Play & Pause</h2>
    <video id="video" src="media/video_sample.mp4"  width="340" height="220"></video>
    <div>
        <!-- video control : button elements -->
        <button id="v-play" type="button">
            play</button>
        <button id="v-pause" type="button" disabled>
            pause</button>
    </div>
</div>


<script>

    var play_button = document.getElementById("v-play");
    var pause_button = document.getElementById("v-pause");

    play_button.addEventListener("click", function () {
        video.play();  //movie play
    }, false);

    pause_button.addEventListener("click", function () {
        video.pause(); //movie pause
    }, false);

    var video = document.getElementById("video");

    video.addEventListener("play", function () {
        play_button.disabled = true;    //play button disabled
        pause_button.disabled = false;  //pause button enabled
    }, false);

    video.addEventListener("pause", function () {
        play_button.disabled = false;   //play button enabled
        pause_button.disabled = true;   //pause button disabled
    }, false);

    video.addEventListener("ended", function () {
        play_button.disabled = false;   //play button enabled
        pause_button.disabled = true;  //pause button disabled
    }, false);
</script>