Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -393,11 +393,17 @@ public void run() {
eventEmitter.loadStart();
loadVideoStarted = true;
}

// Initializing the playerControlView
initializePlayerControl();
setControls(controls);
applyModifiers();

if(ReactExoplayerViewManager.getMuted()){
player.setVolume(0.f);
}else{
player.setVolume(1.f);
}
}
}, 1);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ public class ReactExoplayerViewManager extends ViewGroupManager<ReactExoplayerVi
private static final String PROP_SELECTED_VIDEO_TRACK_VALUE = "value";
private static final String PROP_HIDE_SHUTTER_VIEW = "hideShutterView";
private static final String PROP_CONTROLS = "controls";
private static boolean muted = false;

@Override
public String getName() {
Expand Down Expand Up @@ -199,9 +200,14 @@ public void setPaused(final ReactExoplayerView videoView, final boolean paused)

@ReactProp(name = PROP_MUTED, defaultBoolean = false)
public void setMuted(final ReactExoplayerView videoView, final boolean muted) {
this.muted = muted;
videoView.setMutedModifier(muted);
}

public static boolean getMuted() {
return muted;
}

@ReactProp(name = PROP_VOLUME, defaultFloat = 1.0f)
public void setVolume(final ReactExoplayerView videoView, final float volume) {
videoView.setVolumeModifier(volume);
Expand Down
2 changes: 1 addition & 1 deletion react-native-video.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ Pod::Spec.new do |s|

s.dependency "React"

s.default_subspec = "Video"
s.default_subspec = "VideoCaching"
end