Commit dc6b6967 by Lee Munkyeong

サーバにエンコードした動画を送信したら削除する処理実装

parent eb84ed53
...@@ -124,7 +124,6 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity { ...@@ -124,7 +124,6 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
private final String TAG = "ChatWebViewActivity"; private final String TAG = "ChatWebViewActivity";
private final String NETWORK_ERROR_PLACE_HOLDER = "file:///android_asset/chat/public_new/chat.html"; private final String NETWORK_ERROR_PLACE_HOLDER = "file:///android_asset/chat/public_new/chat.html";
//private final String NETWORK_ERROR_PLACE_HOLDER = "file:///android_asset/chat/public/networkError.html";
private final String CHAT_PAGE_URL = "file:///android_asset/chat/public_new/chat.html"; private final String CHAT_PAGE_URL = "file:///android_asset/chat/public_new/chat.html";
private final String CHAT_ROOM_PAGE_URL = "file:///android_asset/chat/public_new/chat_room.html"; private final String CHAT_ROOM_PAGE_URL = "file:///android_asset/chat/public_new/chat_room.html";
private final String COLLABORATION_PAGE_URL = "file:///android_asset/chat/public_new/collaboration.html"; private final String COLLABORATION_PAGE_URL = "file:///android_asset/chat/public_new/collaboration.html";
...@@ -545,7 +544,7 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity { ...@@ -545,7 +544,7 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
File file = new File(filePath); File file = new File(filePath);
NetworkTask networkTask = new NetworkTask(url, filePath); NetworkTask networkTask = new NetworkTask(url, filePath);
networkTask.execute(); networkTask.execute();
} else if (url.contains("/file/getImage")) { } else if (url.contains("/file/getImage") && !url.contains(".mp4")) {
Uri uri = Uri.parse(url); Uri uri = Uri.parse(url);
String fileName = uri.getQueryParameter("fileName"); String fileName = uri.getQueryParameter("fileName");
String filePath = getFilesDir().getAbsolutePath() + "/" + fileName; String filePath = getFilesDir().getAbsolutePath() + "/" + fileName;
...@@ -791,7 +790,6 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity { ...@@ -791,7 +790,6 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
if (mUploadMessage == null) { if (mUploadMessage == null) {
return; return;
} }
mChatWebView.post(new Runnable() { mChatWebView.post(new Runnable() {
@Override @Override
public void run() { public void run() {
...@@ -806,8 +804,6 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity { ...@@ -806,8 +804,6 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
final String filePath = cursor.getString(cursor.getColumnIndex("_data")); final String filePath = cursor.getString(cursor.getColumnIndex("_data"));
cursor.close(); cursor.close();
Runnable r = new Runnable() { Runnable r = new Runnable() {
@Override @Override
public void run() { public void run() {
...@@ -1581,6 +1577,14 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity { ...@@ -1581,6 +1577,14 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
public int getAndroidVersion() { public int getAndroidVersion() {
return Build.VERSION.SDK_INT; return Build.VERSION.SDK_INT;
} }
@JavascriptInterface
public void removeEncodedVideo(String filePath) {
File encodedVideo = new File(filePath);
if (encodedVideo.exists()) {
encodedVideo.delete();
}
}
} }
/** /**
......
package jp.agentec.abook.abv.ui.home.helper; package jp.agentec.abook.abv.ui.home.helper;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.Context;
import android.graphics.Bitmap; import android.graphics.Bitmap;
import android.media.MediaCodec; import android.media.MediaCodec;
import android.media.MediaCodecInfo; import android.media.MediaCodecInfo;
...@@ -11,7 +9,6 @@ import android.media.MediaExtractor; ...@@ -11,7 +9,6 @@ import android.media.MediaExtractor;
import android.media.MediaFormat; import android.media.MediaFormat;
import android.media.MediaMetadataRetriever; import android.media.MediaMetadataRetriever;
import android.media.MediaMuxer; import android.media.MediaMuxer;
import android.util.Log;
import android.view.Surface; import android.view.Surface;
import java.io.File; import java.io.File;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment