angular - Mute attribute in "mat-video" npm module
问题描述
I'm using mat-video component (npm i mat-video) for playing a video in my angular app. Its pretty good.
<mat-video style="min-height: 30%" quality="false" title="My Tutorial Title" loop="true" [autoplay]="true" [preload]="true" [fullscreen]="true" [download]="false" color="accent" spinner="spin" poster="assets/images/CICDBlog.png">
<source matVideoSource src="assets/videos/samplevideo.mp4" type="video/mp4">
<source src="tutorial.webm" type="video/webm">
<track matVideoTrack src="subtitles_en.vtt" kind="subtitles" srclang="en" label="English">
<track src="subtitles_no.vtt" kind="subtitles" srclang="no" label="Norwegian">
</mat-video>
Do we have such attribute(ex, muted="true") to mute the video after loading the page? I would like to set autoplay="true".
解决方案
在您的文件中使用以下代码.ts
:
this.matVideo.muted = true;
推荐阅读
- php - “不能将 Laminas\Diactoros\UploadedFile 类型的对象用作数组”在 Cakephp 4 中具有多上传输入
- textselection - 在 iPad 上禁用 React Native Webview 文本选择放大镜
- linux - Heroku 上的 Docker 超出内存配额
- c# - JUMP 动画不会停止 unity2D
- python-3.x - 如何在 Cloud Composer 中导入自定义模块
- python - 如何通过函数调用在 python django 模板中设置变量?
- vue.js - 试图让 Vue-heatmapjs 在 nuxt 应用程序上工作
- reactjs - MUI v5 disableBackdropClick 在 createTheme 等效项
- android - Android Retrofit2:在没有 GSON 或 JSONObject 的情况下序列化 null
- swift - 使用 UITableViewDropCoordinator 通过具有可区分数据源的 dropDelegate 动画滴