Commit 5405f280 by Lee Munkyeong

動画エンコード実装

parent e23b43b5
...@@ -243,7 +243,7 @@ $('#image-form').on('submit', function(e) { ...@@ -243,7 +243,7 @@ $('#image-form').on('submit', function(e) {
$('.loader').addClass('active'); $('.loader').addClass('active');
CHAT_UI.showLoadingIndicator(); CHAT_UI.showLoadingIndicator();
var fd = new FormData($(this)[0]); var fd = new FormData($(this)[0]);
console.log($(this)[0]);
//画像の大きさが500pixelより大きかったら、thumbnailを生成 //画像の大きさが500pixelより大きかったら、thumbnailを生成
CHAT.createThumbnailAndUpload(file, function(resizeFile, thumbnailCreated) { CHAT.createThumbnailAndUpload(file, function(resizeFile, thumbnailCreated) {
if (resizeFile && thumbnailCreated) { if (resizeFile && thumbnailCreated) {
...@@ -826,6 +826,51 @@ CHAT_UI.deleteButtonAction = function(isInvite) { ...@@ -826,6 +826,51 @@ CHAT_UI.deleteButtonAction = function(isInvite) {
$('#select_user_list .user_list').find('.userCheckBox').show(); $('#select_user_list .user_list').find('.userCheckBox').show();
} }
CHAT_UI.videoEncodeEnd = function(encodedUri) {
console.log('encode end');
console.log(encodedUri);
// convert base64 to raw binary data held in a string
// doesn't handle URLEncoded DataURIs - see SO answer #6850276 for code that does this
var byteString = atob(encodedUri.split(',')[1]);
// separate out the mime component
var mimeString = encodedUri.split(',')[0].split(':')[1].split(';')[0]
// write the bytes of the string to an ArrayBuffer
var ab = new ArrayBuffer(byteString.length);
// create a view into the buffer
var ia = new Uint8Array(ab);
// set the bytes of the buffer to the correct values
for (var i = 0; i < byteString.length; i++) {
ia[i] = byteString.charCodeAt(i);
}
// write the ArrayBuffer to a blob, and you're done
var blob = new Blob([ab], {type: "video/mp4"});
console.log(blob);
var formData=new FormData();
/*formData.append("fileData",blob,uploadFileName);
formData.append('sid', globalUserInfo.sid);
formData.append('roomId', globalUserInfo.roomId);*/
CHAT_UI.dismissLoadingIndicator();
/* var path = CHAT_DB.loadEncodedFile();
var file = $('#videoInputTag');
file = path;
if (file) {
var fd = new FormData($('#video-form')[0]);
// var requestFile = RequestBody.create(MediaType.parse("video/mp4"), file)
// var fd = new FormData($('#video-form')[0]);
// console.log("kdh check requestFile = " + requestFile);
CHAT.uploadImage(fd);
return;
}*/
};
CHAT_UI.htmlElementTextInitialize = function(languageCode) { CHAT_UI.htmlElementTextInitialize = function(languageCode) {
moment.locale(languageCode); moment.locale(languageCode);
setLanguage(languageCode); setLanguage(languageCode);
......
...@@ -213,7 +213,8 @@ $(function () { ...@@ -213,7 +213,8 @@ $(function () {
coview_api.addEventListener("destroy", function () { coview_api.addEventListener("destroy", function () {
console.log("=============> DESTROY : share destroy"); console.log("=============> DESTROY : share destroy");
coview_api.LeaveRoom(); alert(getLocalizedString("inform_exit_host_collaboration"));
Coview_exitCollaboration();
$(".coview_share_area").hide(); $(".coview_share_area").hide();
$("#loadingIndicator").removeClass("full_active"); $("#loadingIndicator").removeClass("full_active");
}); });
...@@ -346,6 +347,7 @@ $(function () { ...@@ -346,6 +347,7 @@ $(function () {
console.log("consoleLog", json); console.log("consoleLog", json);
break; break;
case "fileChange": case "fileChange":
if (joinCollaborationType != COLLABORATION_TYPE.CAMERA) { break; }
LoadMobileShareFile(json.fileName); LoadMobileShareFile(json.fileName);
backgroundFileName = json.fileName; backgroundFileName = json.fileName;
console.log("fileChange", json); console.log("fileChange", json);
......
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