@@ -80,39 +80,38 @@ public void execute(NativeViewHierarchyManager nvhm) {
80
80
@ ReactMethod
81
81
public void loadPlaylist (final int reactTag , final String playlistUrl ) {
82
82
try {
83
- UIManagerModule uiManager = mReactContext .getNativeModule (UIManagerModule .class );
84
- uiManager .addUIBlock (new UIBlock () {
85
- public void execute (NativeViewHierarchyManager nvhm ) {
86
- RNJWPlayerView playerView = (RNJWPlayerView ) nvhm .resolveView (reactTag );
83
+ UIManagerModule uiManager = mReactContext .getNativeModule (UIManagerModule .class );
84
+ uiManager .addUIBlock (new UIBlock () {
85
+ public void execute (NativeViewHierarchyManager nvhm ) {
86
+ RNJWPlayerView playerView = (RNJWPlayerView ) nvhm .resolveView (reactTag );
87
+ if (playerView != null && playerView .mPlayerView != null ) {
88
+ JWPlayer player = playerView .mPlayerView .getPlayer ();
87
89
88
- if (playerView != null && playerView .mPlayerView != null ) {
89
- JWPlayer player = playerView .mPlayerView .getPlayer ();
90
-
91
- PlayerConfig oldConfig = player .getConfig ();
92
- PlayerConfig config = new PlayerConfig .Builder ()
93
- .autostart (oldConfig .getAutostart ())
94
- .nextUpOffset (oldConfig .getNextUpOffset ())
95
- .repeat (oldConfig .getRepeat ())
96
- .relatedConfig (oldConfig .getRelatedConfig ())
97
- .displayDescription (oldConfig .getDisplayDescription ())
98
- .displayTitle (oldConfig .getDisplayTitle ())
99
- .advertisingConfig (oldConfig .getAdvertisingConfig ())
100
- .stretching (oldConfig .getStretching ())
101
- .uiConfig (oldConfig .getUiConfig ())
102
- .playlistUrl (playlistUrl )
103
- .allowCrossProtocolRedirects (oldConfig .getAllowCrossProtocolRedirects ())
104
- .preload (oldConfig .getPreload ())
105
- .useTextureView (oldConfig .useTextureView ())
106
- .thumbnailPreview (oldConfig .getThumbnailPreview ())
107
- .mute (oldConfig .getMute ())
108
- .build ();
109
-
110
- player .setup (config );
111
- }
112
- }
113
- });
90
+ PlayerConfig oldConfig = player .getConfig ();
91
+ PlayerConfig config = new PlayerConfig .Builder ()
92
+ .autostart (oldConfig .getAutostart ())
93
+ .nextUpOffset (oldConfig .getNextUpOffset ())
94
+ .repeat (oldConfig .getRepeat ())
95
+ .relatedConfig (oldConfig .getRelatedConfig ())
96
+ .displayDescription (oldConfig .getDisplayDescription ())
97
+ .displayTitle (oldConfig .getDisplayTitle ())
98
+ .advertisingConfig (oldConfig .getAdvertisingConfig ())
99
+ .stretching (oldConfig .getStretching ())
100
+ .uiConfig (oldConfig .getUiConfig ())
101
+ .playlistUrl (playlistUrl )
102
+ .allowCrossProtocolRedirects (oldConfig .getAllowCrossProtocolRedirects ())
103
+ .preload (oldConfig .getPreload ())
104
+ .useTextureView (oldConfig .useTextureView ())
105
+ .thumbnailPreview (oldConfig .getThumbnailPreview ())
106
+ .mute (oldConfig .getMute ())
107
+ .build ();
108
+
109
+ player .setup (config );
110
+ }
111
+ }
112
+ });
114
113
} catch (IllegalViewOperationException e ) {
115
- throw e ;
114
+ throw e ;
116
115
}
117
116
}
118
117
0 commit comments