Skip to content

Commit

Permalink
change setOptions
Browse files Browse the repository at this point in the history
  • Loading branch information
pedroSG94 committed Mar 19, 2018
1 parent 4efa0ae commit f887181
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ allprojects {
}
}
dependencies {
compile 'com.github.pedroSG94.vlc-example-streamplayer:pedrovlc:2.5.14'
compile 'com.github.pedroSG94.vlc-example-streamplayer:pedrovlc:2.5.14v3'
}
```

Expand All @@ -33,6 +33,6 @@ allprojects {
}
}
dependencies {
compile 'com.github.pedroSG94.vlc-example-streamplayer:libvlc:2.5.14'
compile 'com.github.pedroSG94.vlc-example-streamplayer:libvlc:2.5.14v3'
}
```
4 changes: 4 additions & 0 deletions app/src/main/java/com/pedro/vlctestapp/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import android.widget.Toast;
import com.pedro.vlc.VlcListener;
import com.pedro.vlc.VlcVideoLibrary;
import java.util.Arrays;

/**
* Created by pedro on 25/06/17.
Expand All @@ -20,6 +21,8 @@ public class MainActivity extends AppCompatActivity implements VlcListener, View
private Button bStartStop;
private EditText etEndpoint;

private String[] options = new String[]{":fullscreen"};

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Expand All @@ -30,6 +33,7 @@ protected void onCreate(Bundle savedInstanceState) {
bStartStop.setOnClickListener(this);
etEndpoint = (EditText) findViewById(R.id.et_endpoint);
vlcVideoLibrary = new VlcVideoLibrary(this, this, surfaceView);
vlcVideoLibrary.setOptions(Arrays.asList(options));
}

@Override
Expand Down
10 changes: 8 additions & 2 deletions pedrovlc/src/main/java/com/pedro/vlc/VlcVideoLibrary.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import android.view.SurfaceView;
import android.view.TextureView;
import java.util.ArrayList;
import java.util.List;
import org.videolan.libvlc.IVLCVout;
import org.videolan.libvlc.LibVLC;
import org.videolan.libvlc.Media;
Expand All @@ -29,7 +30,7 @@ public class VlcVideoLibrary implements MediaPlayer.EventListener {
private SurfaceTexture surfaceTexture;
private Surface surface;
private SurfaceHolder surfaceHolder;
private ArrayList<String> options = new ArrayList<>();
private List<String> options = new ArrayList<>();

public VlcVideoLibrary(Context context, VlcListener vlcListener, SurfaceView surfaceView) {
this.vlcListener = vlcListener;
Expand Down Expand Up @@ -91,7 +92,12 @@ public VlcVideoLibrary(Context context, VlcListener vlcListener, Surface surface
options.add(":fullscreen");
}

public void setOptions(ArrayList<String> options) {
/**
* This method should be called after constructor and before play methods.
*
* @param options seeted to VLC player.
*/
public void setOptions(List<String> options) {
this.options = options;
}

Expand Down

0 comments on commit f887181

Please sign in to comment.