From bfc2d6d1b589780bf5063c94f1f476630db32065 Mon Sep 17 00:00:00 2001 From: James Leahy Date: Thu, 27 Jul 2023 07:32:50 +0200 Subject: [PATCH] chore: Use removeAttribute --- .../video_player_web/lib/src/video_player.dart | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/packages/video_player/video_player_web/lib/src/video_player.dart b/packages/video_player/video_player_web/lib/src/video_player.dart index 9eed4d3f0ed5..6a85f75d0c2c 100644 --- a/packages/video_player/video_player_web/lib/src/video_player.dart +++ b/packages/video_player/video_player_web/lib/src/video_player.dart @@ -232,19 +232,13 @@ class VideoPlayer { void _resetOptions() { _videoElement.controls = false; - if (_videoElement.hasAttribute('controlsList')) { - _videoElement.setAttribute('controlsList', ''); - } - if (_videoElement.hasAttribute('disablePictureInPicture')) { - _videoElement.setAttribute('disablePictureInPicture', false); - } + _videoElement.removeAttribute('controlsList'); + _videoElement.removeAttribute('disablePictureInPicture'); if (_onContextMenu != null) { _videoElement.removeEventListener('contextmenu', _onContextMenu); _onContextMenu = null; } - if (_videoElement.hasAttribute('disableRemotePlayback')) { - _videoElement.setAttribute('disableRemotePlayback', false); - } + _videoElement.removeAttribute('disableRemotePlayback'); } /// Disposes of the current [html.VideoElement].