<template>
  <!-- #ifdef WEB -->
  <view>
  <!-- #endif -->
    <list-view class="list">
      <list-item class="list-item" v-for="(_,index) in 20">
        <text>第{{index + 1}}个视频</text>
        <video class="video" :src="src" :controls="true" @pause="onPause"></video>
      </list-item>
    </list-view>
  <!-- #ifdef WEB -->
  </view>
  <!-- #endif -->
</template>

<script>
  export default {
    data() {
      return {
        src: 'https://qiniu-web-assets.dcloud.net.cn/video/sample/2minute-demo.mp4'
      }
    },
    methods: {
      onPause(e : UniEvent) {
        console.log(JSON.stringify(e));
      }
    }
  }
</script>

<style>
  .list {
    flex: 1;
  }

  .list-item {
    background-color: white;
    margin-bottom: 30px;
  }

  .video {
    width: 100%;
    height: 200px;
  }
</style>
