Java Code Examples for com.facebook.react.bridge.ReadableMap#getDynamic()

The following examples show how to use com.facebook.react.bridge.ReadableMap#getDynamic() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ReactExoplayerViewManager.java    From react-native-video with MIT License 5 votes vote down vote up
@ReactProp(name = PROP_SELECTED_VIDEO_TRACK)
public void setSelectedVideoTrack(final ReactExoplayerView videoView,
                                 @Nullable ReadableMap selectedVideoTrack) {
    String typeString = null;
    Dynamic value = null;
    if (selectedVideoTrack != null) {
        typeString = selectedVideoTrack.hasKey(PROP_SELECTED_VIDEO_TRACK_TYPE)
                ? selectedVideoTrack.getString(PROP_SELECTED_VIDEO_TRACK_TYPE) : null;
        value = selectedVideoTrack.hasKey(PROP_SELECTED_VIDEO_TRACK_VALUE)
                ? selectedVideoTrack.getDynamic(PROP_SELECTED_VIDEO_TRACK_VALUE) : null;
    }
    videoView.setSelectedVideoTrack(typeString, value);
}
 
Example 2
Source File: ReactExoplayerViewManager.java    From react-native-video with MIT License 5 votes vote down vote up
@ReactProp(name = PROP_SELECTED_AUDIO_TRACK)
public void setSelectedAudioTrack(final ReactExoplayerView videoView,
                                 @Nullable ReadableMap selectedAudioTrack) {
    String typeString = null;
    Dynamic value = null;
    if (selectedAudioTrack != null) {
        typeString = selectedAudioTrack.hasKey(PROP_SELECTED_AUDIO_TRACK_TYPE)
                ? selectedAudioTrack.getString(PROP_SELECTED_AUDIO_TRACK_TYPE) : null;
        value = selectedAudioTrack.hasKey(PROP_SELECTED_AUDIO_TRACK_VALUE)
                ? selectedAudioTrack.getDynamic(PROP_SELECTED_AUDIO_TRACK_VALUE) : null;
    }
    videoView.setSelectedAudioTrack(typeString, value);
}
 
Example 3
Source File: ReactExoplayerViewManager.java    From react-native-video with MIT License 5 votes vote down vote up
@ReactProp(name = PROP_SELECTED_TEXT_TRACK)
public void setSelectedTextTrack(final ReactExoplayerView videoView,
                                 @Nullable ReadableMap selectedTextTrack) {
    String typeString = null;
    Dynamic value = null;
    if (selectedTextTrack != null) {
        typeString = selectedTextTrack.hasKey(PROP_SELECTED_TEXT_TRACK_TYPE)
                ? selectedTextTrack.getString(PROP_SELECTED_TEXT_TRACK_TYPE) : null;
        value = selectedTextTrack.hasKey(PROP_SELECTED_TEXT_TRACK_VALUE)
                ? selectedTextTrack.getDynamic(PROP_SELECTED_TEXT_TRACK_VALUE) : null;
    }
    videoView.setSelectedTextTrack(typeString, value);
}