use itent to read the output video
authorDralagen <dralagen@dralagen.fr>
Tue, 7 Apr 2015 22:43:53 +0000 (00:43 +0200)
committerDralagen <dralagen@dralagen.fr>
Tue, 7 Apr 2015 22:43:53 +0000 (00:43 +0200)
app/src/main/java/org/alma/rotoscope/DrawingActivity.java
app/src/main/res/layout/activity_drawing.xml
app/src/main/res/values/strings.xml

index 5a2fc6d..b48c046 100644 (file)
@@ -485,6 +485,23 @@ public class DrawingActivity extends Activity implements View.OnTouchListener {
     }).start();
   }
 
+  public void playVideo(View vew) {
+    final Thread encodeVideoThread = (outputVideo == null) ? encodeVideo() : new Thread();
+
+    new Thread(new Runnable() {
+      @Override
+      public void run() {
+        try {
+          encodeVideoThread.join();
+        } catch (InterruptedException ignore) {}
+
+        Intent viewIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(outputVideo.getParent()));
+        viewIntent.setDataAndType(Uri.parse(outputVideo.getPath()), "video/mp4");
+        startActivity(viewIntent);
+      }
+    }).start();
+  }
+
   /**
    * Copy the content of src into dest file
    *
index bf665c9..aa8ebd0 100644 (file)
         android:src="@android:drawable/ic_menu_save" android:contentDescription="@string/button_save"
         android:onClick="saveVideo" android:layout_marginBottom="4pt" android:clickable="true"/>
     <ImageView
-        android:layout_width="fill_parent"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:id="@+id/playButton" android:layout_marginBottom="4pt" android:src="@android:drawable/ic_media_play"
+        android:onClick="playVideo" android:clickable="true" android:contentDescription="@string/button_play"/>
+    <ImageView
+        android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:id="@+id/shareButton" android:src="@android:drawable/ic_menu_share" android:contentDescription="@string/button_share"
         android:onClick="shareVideo" android:layout_marginBottom="16pt" android:clickable="true"/>
         android:contentDescription="@string/button_colorPicker" android:layout_marginBottom="4pt"
         android:clickable="true"/>
     <ImageView
-        android:layout_width="wrap_content"
+        android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:id="@+id/toggleBackgroundButton" android:src="@android:drawable/ic_menu_gallery" android:onClick="toggleBackground"
         android:contentDescription="@string/button_toggleBackground" android:layout_marginBottom="4pt"
         android:clickable="true" android:focusable="false" android:alpha="0.5"/>
     <ImageView
-        android:layout_width="fill_parent"
+        android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:id="@+id/eraseButton" android:src="@android:drawable/ic_menu_delete" android:onClick="erasePicture"
         android:contentDescription="@string/button_clearLayer" android:layout_marginBottom="4pt"
index a487bfd..8b5b088 100644 (file)
@@ -18,6 +18,7 @@
     <string name="button_colorPicker">Change color</string>
     <string name="send_to">Share your video</string>
     <string name="button_toggleBackground">Toggle Background</string>
+    <string name="button_play">Play</string>
 
 
 </resources>