From 39710709e8cc04f22fcd6ef35ba076bbb5447cb8 Mon Sep 17 00:00:00 2001 From: Oleksandr Fediashov Date: Mon, 26 Aug 2019 14:02:07 +0200 Subject: [PATCH] fix(Video): fix `muted` prop (#1847) * fix(Video): fix `muted` prop * update changelog --- CHANGELOG.md | 3 +++ packages/react/src/components/Video/Video.tsx | 6 +----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 79dd755da6..26e552c9a0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,9 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm ## [Unreleased] +### Fixes +- Fix `muted` prop in `Video` component @layershifter ([#1847](https://github.com/stardust-ui/react/pull/1847)) + ## [v0.37.0](https://github.com/stardust-ui/react/tree/v0.37.0) (2019-08-26) [Compare changes](https://github.com/stardust-ui/react/compare/v0.36.2...v0.37.0) diff --git a/packages/react/src/components/Video/Video.tsx b/packages/react/src/components/Video/Video.tsx index 600a0d4346..1929d414ea 100644 --- a/packages/react/src/components/Video/Video.tsx +++ b/packages/react/src/components/Video/Video.tsx @@ -67,11 +67,7 @@ class Video extends UIComponent> { // React doesn't guaranty that props will be set: // https://github.com/facebook/react/issues/10389 if (this.videoRef.current) { - if (this.props.muted) { - this.videoRef.current.setAttribute('muted', 'true') - } else { - this.videoRef.current.removeAttribute('muted') - } + this.videoRef.current.muted = !!this.props.muted } }