<template> <view class="content"> <video id="coursewareVideo" :src="src" controls autoplay="autoplay" style="width: 100%;"></video> </view> </template> <script> import {getPlatVideoPlay, loginVideoPlat} from "@/api"; export default { data() { return { info: {}, src:'' } }, onLoad(options) { this.info = options this.fnInit() }, methods: { fnInit(){ this.fnInitVideoPlat() }, async fnInitVideoPlat(){ const resData = await getPlatVideoPlay({ serial: this.info.serial , code: this.info.code, channel: 1, }) this.src =resData.HLS }, fnBack() { uni.$u.route({ type: 'navigateBack' }) } }, } </script> <style lang="scss" scoped> .content { background-color: #fff; padding: 0 20upx; } .button { text-align: center; margin-top: 40upx; margin-bottom: 40upx; button { width: 70%; } } </style>