@@ -49,13 +49,16 @@ function create_fragment(ctx) {
49
49
50
50
audio . volume = ctx . volume ;
51
51
52
+ audio . muted = ! ! ctx . muted ;
53
+
52
54
audio . playbackRate = ctx . playbackRate ;
53
55
} ,
54
56
55
57
p ( changed , ctx ) {
56
58
if ( ! audio_updating && changed . currentTime && ! isNaN ( ctx . currentTime ) ) audio . currentTime = ctx . currentTime ;
57
59
if ( changed . paused && audio_is_paused !== ( audio_is_paused = ctx . paused ) ) audio [ audio_is_paused ? "pause" : "play" ] ( ) ;
58
60
if ( changed . volume && ! isNaN ( ctx . volume ) ) audio . volume = ctx . volume ;
61
+ if ( changed . muted ) audio . muted = ! ! ctx . muted ;
59
62
if ( changed . playbackRate && ! isNaN ( ctx . playbackRate ) ) audio . playbackRate = ctx . playbackRate ;
60
63
audio_updating = false ;
61
64
} ,
@@ -74,7 +77,7 @@ function create_fragment(ctx) {
74
77
}
75
78
76
79
function instance ( $$self , $$props , $$invalidate ) {
77
- let { buffered, seekable, played, currentTime, duration, paused, volume, playbackRate } = $$props ;
80
+ let { buffered, seekable, played, currentTime, duration, paused, volume, muted , playbackRate } = $$props ;
78
81
79
82
function audio_timeupdate_handler ( ) {
80
83
played = time_ranges_to_array ( this . played ) ;
@@ -107,7 +110,9 @@ function instance($$self, $$props, $$invalidate) {
107
110
108
111
function audio_volumechange_handler ( ) {
109
112
volume = this . volume ;
113
+ muted = this . muted ;
110
114
$$invalidate ( 'volume' , volume ) ;
115
+ $$invalidate ( 'muted' , muted ) ;
111
116
}
112
117
113
118
function audio_ratechange_handler ( ) {
@@ -123,6 +128,7 @@ function instance($$self, $$props, $$invalidate) {
123
128
if ( 'duration' in $$props ) $$invalidate ( 'duration' , duration = $$props . duration ) ;
124
129
if ( 'paused' in $$props ) $$invalidate ( 'paused' , paused = $$props . paused ) ;
125
130
if ( 'volume' in $$props ) $$invalidate ( 'volume' , volume = $$props . volume ) ;
131
+ if ( 'muted' in $$props ) $$invalidate ( 'muted' , muted = $$props . muted ) ;
126
132
if ( 'playbackRate' in $$props ) $$invalidate ( 'playbackRate' , playbackRate = $$props . playbackRate ) ;
127
133
} ;
128
134
@@ -134,6 +140,7 @@ function instance($$self, $$props, $$invalidate) {
134
140
duration,
135
141
paused,
136
142
volume,
143
+ muted,
137
144
playbackRate,
138
145
audio_timeupdate_handler,
139
146
audio_durationchange_handler,
@@ -148,8 +155,8 @@ function instance($$self, $$props, $$invalidate) {
148
155
class Component extends SvelteComponent {
149
156
constructor ( options ) {
150
157
super ( ) ;
151
- init ( this , options , instance , create_fragment , safe_not_equal , [ "buffered" , "seekable" , "played" , "currentTime" , "duration" , "paused" , "volume" , "playbackRate" ] ) ;
158
+ init ( this , options , instance , create_fragment , safe_not_equal , [ "buffered" , "seekable" , "played" , "currentTime" , "duration" , "paused" , "volume" , "muted" , " playbackRate"] ) ;
152
159
}
153
160
}
154
161
155
- export default Component ;
162
+ export default Component ;
0 commit comments