-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Lucem-Anb
committed
Oct 22, 2018
1 parent
dc52626
commit ba9e8d5
Showing
26 changed files
with
177 additions
and
156 deletions.
There are no files selected for viewing
Binary file not shown.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
package com.lucemanb; | ||
|
||
import android.app.Activity; | ||
import android.graphics.SurfaceTexture; | ||
import android.media.MediaPlayer; | ||
import android.os.Bundle; | ||
import android.view.Surface; | ||
import android.view.TextureView; | ||
|
||
import com.lucemanb.zoomable.ZoomableTextureView; | ||
|
||
import java.io.IOException; | ||
import hbisoft.com.surfaceviewpinchzoom.R; | ||
|
||
|
||
public class MainActivity extends Activity{ | ||
|
||
String path = "http://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_320x180.mp4"; | ||
private MediaPlayer mediaPlayerTexture; | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_main); | ||
|
||
final MediaPlayer.OnPreparedListener listener = new MediaPlayer.OnPreparedListener() { | ||
@Override | ||
public void onPrepared(MediaPlayer mp) { | ||
mp.start(); | ||
} | ||
}; | ||
|
||
ZoomableTextureView textureView = findViewById(R.id.textureView); | ||
|
||
textureView.setSurfaceTextureListener(new TextureView.SurfaceTextureListener() { | ||
@Override | ||
public void onSurfaceTextureAvailable(SurfaceTexture surface, int width, int height) { | ||
Surface s = new Surface(surface); | ||
mediaPlayerTexture = new MediaPlayer(); | ||
mediaPlayerTexture.setSurface(s); | ||
try { | ||
mediaPlayerTexture.setDataSource(path); | ||
} catch (IOException e) { | ||
e.printStackTrace(); | ||
} | ||
mediaPlayerTexture.prepareAsync(); | ||
mediaPlayerTexture.setOnPreparedListener(listener); | ||
} | ||
|
||
@Override | ||
public void onSurfaceTextureSizeChanged(SurfaceTexture surface, int width, int height) { | ||
|
||
} | ||
|
||
@Override | ||
public boolean onSurfaceTextureDestroyed(SurfaceTexture surface) { | ||
return false; | ||
} | ||
|
||
@Override | ||
public void onSurfaceTextureUpdated(SurfaceTexture surface) { | ||
|
||
} | ||
}); | ||
} | ||
|
||
@Override | ||
protected void onDestroy() { | ||
super.onDestroy(); | ||
if (mediaPlayerTexture != null) { | ||
mediaPlayerTexture.release(); | ||
mediaPlayerTexture = null; | ||
} | ||
} | ||
|
||
} |
88 changes: 0 additions & 88 deletions
88
app/src/main/java/hbisoft/com/surfaceviewpinchzoom/MainActivity.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
android:layout_width="match_parent" | ||
android:orientation="vertical" | ||
android:layout_height="match_parent" | ||
tools:context=".Frames"> | ||
|
||
<SeekBar | ||
android:layout_width="match_parent" | ||
android:layout_margin="8dp" | ||
android:id="@+id/control" | ||
android:background="@color/colorPrimary" | ||
android:layout_height="10dp" /> | ||
|
||
<hbisoft.com.surfaceviewpinchzoom.layout.PlayerView | ||
android:layout_width="match_parent" | ||
android:id="@+id/player" | ||
android:layout_height="match_parent" /> | ||
|
||
</LinearLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#Mon May 21 10:37:33 SAST 2018 | ||
#Mon Oct 22 17:28:38 EAT 2018 | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip |
Oops, something went wrong.