Commit 69fb9ed6 by Masaru Abe

パフォーマンス改善 JS暗号化エラー対応

parent 999c601a
/// <reference path="../common/js/jquery-ui-1.8.23.custom.min.js" />
/// <reference path="../common/js/common.js" />
/// <reference path="contentview_VarDef.js" />
/// <reference path="contentview_CallApi.js" />
/// <reference path="contentview_GetData.js" />
/// <reference path="contentview_InitObjects.js" />
/// <reference path="contentview_Events.js" />
/* ----------------------------------- Create memo --------------------------------*/ /* ----------------------------------- Create memo --------------------------------*/
...@@ -1354,7 +1347,6 @@ var videoType2 = function (mediaType, actionType, id, imageUrl, x, y, w, h, visi ...@@ -1354,7 +1347,6 @@ var videoType2 = function (mediaType, actionType, id, imageUrl, x, y, w, h, visi
this.setup(mediaType, actionType, id, imageUrl, x, y, w, h, visible, null, embed, objectId); this.setup(mediaType, actionType, id, imageUrl, x, y, w, h, visible, null, embed, objectId);
this.action = function () { this.action = function () {
//abe
//alert("videoType2:" + getPageIndex()); //alert("videoType2:" + getPageIndex());
//詳細ログ作成 //詳細ログ作成
...@@ -1391,40 +1383,23 @@ var videoType2 = function (mediaType, actionType, id, imageUrl, x, y, w, h, visi ...@@ -1391,40 +1383,23 @@ var videoType2 = function (mediaType, actionType, id, imageUrl, x, y, w, h, visi
//タグは書き出し //タグは書き出し
createVideoFulScreen(mediaFile, id); createVideoFulScreen(mediaFile, id);
//$("#btnCloseVideo").click(function (e) {
// //時間記録
// hideDialog();
// /*play audio if exist */
// playAllAudio();
//
//});
console.log("aaaaa");
$("#btnCloseVideo").on({ $("#btnCloseVideo").on({
'click': function(){ 'click touchend': function(ev){
console.log("#btnCloseVideo click touchend");
//時間記録 //時間記録
hideDialog(); hideDialog();
/*play audio if exist */ /*play audio if exist */
playAllAudio(); playAllAudio();
return false;
}, },
'touchstart': function(){ 'touchstart touchmove': function(){
console.log("touchstart"); //これを入れないと次にダイアログを開くと表示位置が大きくズレる
}, //console.log("#btnCloseVideo touchstart touchmove");
'touchmove': function(){ return false;
console.log("touchmove");
},
'touchend': function(){
console.log("touchend");
//時間記録
hideDialog();
/*play audio if exist */
playAllAudio();
} }
}); });
showDialog(true); showDialog(true);
} else { } else {
//キャッシュが存在するか確認 //キャッシュが存在するか確認
...@@ -1438,15 +1413,6 @@ var videoType2 = function (mediaType, actionType, id, imageUrl, x, y, w, h, visi ...@@ -1438,15 +1413,6 @@ var videoType2 = function (mediaType, actionType, id, imageUrl, x, y, w, h, visi
console.log("read cache: createObjectURL " + resSrc); console.log("read cache: createObjectURL " + resSrc);
createVideoFulScreen(resSrc, id); createVideoFulScreen(resSrc, id);
//$("#btnCloseVideo").click(function (e) {
// //時間記録
// hideDialog();
// /*play audio if exist */
// playAllAudio();
//
//});
console.log("bbbbbb");
$("#btnCloseVideo").on({ $("#btnCloseVideo").on({
'click touchend': function(ev){ 'click touchend': function(ev){
console.log("#btnCloseVideo click touchend"); console.log("#btnCloseVideo click touchend");
...@@ -1458,11 +1424,11 @@ var videoType2 = function (mediaType, actionType, id, imageUrl, x, y, w, h, visi ...@@ -1458,11 +1424,11 @@ var videoType2 = function (mediaType, actionType, id, imageUrl, x, y, w, h, visi
}, },
'touchstart touchmove': function(){ 'touchstart touchmove': function(){
//これを入れないと次にダイアログを開くと表示位置が大きくズレる //これを入れないと次にダイアログを開くと表示位置が大きくズレる
console.log("#btnCloseVideo touchstart touchmove"); //console.log("#btnCloseVideo touchstart touchmove");
return false; return false;
} }
}); });
showDialog(true); showDialog(true);
} }
...@@ -1495,7 +1461,6 @@ var videoType2 = function (mediaType, actionType, id, imageUrl, x, y, w, h, visi ...@@ -1495,7 +1461,6 @@ var videoType2 = function (mediaType, actionType, id, imageUrl, x, y, w, h, visi
}; };
var blobData = new Blob([xhr.response], {type:"application/octet-stream"}); var blobData = new Blob([xhr.response], {type:"application/octet-stream"});
//var blobData = new Blob([this.response], {type:"video/mp4"});
fileWriter.write(blobData); fileWriter.write(blobData);
} }
...@@ -1506,11 +1471,12 @@ var videoType2 = function (mediaType, actionType, id, imageUrl, x, y, w, h, visi ...@@ -1506,11 +1471,12 @@ var videoType2 = function (mediaType, actionType, id, imageUrl, x, y, w, h, visi
} else { } else {
if( this.readyState == 2 ){ if( this.readyState == 2 ){
console.log("onreadystatechange:" + this.readyState + " " + this.status);
CONTENTVIEW_FILESYSTEM.isXhrBusy = true;
$('#divImageLoading').css('z-index', '99999'); $('#divImageLoading').css('z-index', '99999');
$('#divImageLoading').css('display', 'block'); $('#divImageLoading').css('display', 'block');
} }
console.log("onreadystatechange:" + this.readyState + " " + this.status); //console.log("onreadystatechange:" + this.readyState + " " + this.status);
} }
} }
...@@ -1518,19 +1484,27 @@ var videoType2 = function (mediaType, actionType, id, imageUrl, x, y, w, h, visi ...@@ -1518,19 +1484,27 @@ var videoType2 = function (mediaType, actionType, id, imageUrl, x, y, w, h, visi
xhr.open('GET', mediaFile); xhr.open('GET', mediaFile);
xhr.responseType = 'blob'; xhr.responseType = 'blob';
xhr.send(); xhr.send();
CONTENTVIEW_FILESYSTEM.isXhrBusy = true;
} else { } else {
console.log("xhr is busy."); console.log("xhr is busy.");
} }
//タグは書き出し //タグは書き出し
createVideoFulScreen(mediaFile, id); createVideoFulScreen(mediaFile, id);
$("#btnCloseVideo").click(function (e) { $("#btnCloseVideo").on({
//時間記録 'click touchend': function(ev){
hideDialog(); console.log("#btnCloseVideo click touchend");
/*play audio if exist */ //時間記録
playAllAudio(); hideDialog();
}); /*play audio if exist */
playAllAudio();
return false;
},
'touchstart touchmove': function(){
//これを入れないと次にダイアログを開くと表示位置が大きくズレる
//console.log("#btnCloseVideo touchstart touchmove");
return false;
}
});
showDialog(true); showDialog(true);
} }
...@@ -1538,35 +1512,10 @@ var videoType2 = function (mediaType, actionType, id, imageUrl, x, y, w, h, visi ...@@ -1538,35 +1512,10 @@ var videoType2 = function (mediaType, actionType, id, imageUrl, x, y, w, h, visi
} }
//createVideoFulScreen(mediaFile, id);
//$("#btnCloseVideo").click(function (e) {
// //時間記録
// hideDialog();
// /*play audio if exist */
// playAllAudio();
//});
//showDialog(true);
} }
} }
}; };
}; };
//キャッシュ対応で非同期になった対応
function videoType2CreateVideoFulScreenAfterFunc(){
$("#btnCloseVideo").click(function (e) {
//時間記録
hideDialog();
/*play audio if exist */
playAllAudio();
});
showDialog(true);
}
videoType2.prototype = new PageObject(); videoType2.prototype = new PageObject();
/* mediaType = 1 and actionType = 0 linkURL object*/ /* mediaType = 1 and actionType = 0 linkURL object*/
...@@ -1612,15 +1561,23 @@ var videoType1 = function (mediaType, actionType, id, imageUrl, x, y, w, h, visi ...@@ -1612,15 +1561,23 @@ var videoType1 = function (mediaType, actionType, id, imageUrl, x, y, w, h, visi
//タグは書き出し //タグは書き出し
createVideoFulScreen(mediaFile, id); createVideoFulScreen(mediaFile, id);
$("#btnCloseVideo").click(function (e) { $("#btnCloseVideo").on({
//時間記録 'click touchend': function(ev){
var dateEnd = new Date(); console.log("#btnCloseVideo click touchend");
var actionTime = dateEnd.subtractBySeconds(dateStart); //時間記録
//alert("actionTime:" + actionTime); var dateEnd = new Date();
SetObjectLogActionTime( contentID, objectId, actionTime ); var actionTime = dateEnd.subtractBySeconds(dateStart);
hideDialog(); SetObjectLogActionTime( contentID, objectId, actionTime );
/* play audio */ hideDialog();
playAllAudio(); /* play audio */
playAllAudio();
return false;
},
'touchstart touchmove': function(){
//これを入れないと次にダイアログを開くと表示位置が大きくズレる
//console.log("#btnCloseVideo touchstart touchmove");
return false;
}
}); });
showDialog(true); showDialog(true);
...@@ -1638,17 +1595,26 @@ var videoType1 = function (mediaType, actionType, id, imageUrl, x, y, w, h, visi ...@@ -1638,17 +1595,26 @@ var videoType1 = function (mediaType, actionType, id, imageUrl, x, y, w, h, visi
//タグは書き出し //タグは書き出し
createVideoFulScreen(resSrc, id); createVideoFulScreen(resSrc, id);
$("#btnCloseVideo").click(function (e) { $("#btnCloseVideo").on({
//時間記録 'click touchend': function(ev){
var dateEnd = new Date(); console.log("#btnCloseVideo click touchend");
var actionTime = dateEnd.subtractBySeconds(dateStart); //時間記録
//alert("actionTime:" + actionTime); var dateEnd = new Date();
SetObjectLogActionTime( contentID, objectId, actionTime ); var actionTime = dateEnd.subtractBySeconds(dateStart);
hideDialog(); //alert("actionTime:" + actionTime);
/* play audio */ SetObjectLogActionTime( contentID, objectId, actionTime );
playAllAudio(); hideDialog();
}); /* play audio */
showDialog(true); playAllAudio();
return false;
},
'touchstart touchmove': function(){
//これを入れないと次にダイアログを開くと表示位置が大きくズレる
//console.log("#btnCloseVideo touchstart touchmove");
return false;
}
});
showDialog(true);
} }
); );
...@@ -1690,8 +1656,9 @@ var videoType1 = function (mediaType, actionType, id, imageUrl, x, y, w, h, visi ...@@ -1690,8 +1656,9 @@ var videoType1 = function (mediaType, actionType, id, imageUrl, x, y, w, h, visi
); );
} else { } else {
console.log("onreadystatechange:" + this.readyState + " " + this.status);
if( this.readyState == 2 ){ if( this.readyState == 2 ){
console.log("onreadystatechange:" + this.readyState + " " + this.status);
CONTENTVIEW_FILESYSTEM.isXhrBusy = true;
$('#divImageLoading').css('z-index', '99999'); $('#divImageLoading').css('z-index', '99999');
$('#divImageLoading').css('display', 'block'); $('#divImageLoading').css('display', 'block');
} }
...@@ -1702,22 +1669,30 @@ var videoType1 = function (mediaType, actionType, id, imageUrl, x, y, w, h, visi ...@@ -1702,22 +1669,30 @@ var videoType1 = function (mediaType, actionType, id, imageUrl, x, y, w, h, visi
xhr.open('GET', mediaFile); xhr.open('GET', mediaFile);
xhr.responseType = 'blob'; xhr.responseType = 'blob';
xhr.send(); xhr.send();
CONTENTVIEW_FILESYSTEM.isXhrBusy = true;
} else { } else {
console.log("xhr is busy."); console.log("xhr is busy.");
} }
//タグは書き出し //タグは書き出し
createVideoFulScreen(mediaFile, id); createVideoFulScreen(mediaFile, id);
$("#btnCloseVideo").click(function (e) { $("#btnCloseVideo").on({
//時間記録 'click touchend': function(ev){
var dateEnd = new Date(); console.log("#btnCloseVideo click touchend");
var actionTime = dateEnd.subtractBySeconds(dateStart); //時間記録
//alert("actionTime:" + actionTime); var dateEnd = new Date();
SetObjectLogActionTime( contentID, objectId, actionTime ); var actionTime = dateEnd.subtractBySeconds(dateStart);
hideDialog(); //alert("actionTime:" + actionTime);
/* play audio */ SetObjectLogActionTime( contentID, objectId, actionTime );
playAllAudio(); hideDialog();
/* play audio */
playAllAudio();
return false;
},
'touchstart touchmove': function(){
//これを入れないと次にダイアログを開くと表示位置が大きくズレる
//console.log("#btnCloseVideo touchstart touchmove");
return false;
}
}); });
showDialog(true); showDialog(true);
...@@ -1726,19 +1701,6 @@ var videoType1 = function (mediaType, actionType, id, imageUrl, x, y, w, h, visi ...@@ -1726,19 +1701,6 @@ var videoType1 = function (mediaType, actionType, id, imageUrl, x, y, w, h, visi
} }
//createVideoFulScreen(mediaFile, id);
//$("#btnCloseVideo").click(function (e) {
// //時間記録
// var dateEnd = new Date();
// var actionTime = dateEnd.subtractBySeconds(dateStart);
// //alert("actionTime:" + actionTime);
// SetObjectLogActionTime( contentID, objectId, actionTime );
// hideDialog();
// /* play audio */
// playAllAudio();
//});
//showDialog(true);
} }
//時間記録 //時間記録
...@@ -1746,10 +1708,6 @@ var videoType1 = function (mediaType, actionType, id, imageUrl, x, y, w, h, visi ...@@ -1746,10 +1708,6 @@ var videoType1 = function (mediaType, actionType, id, imageUrl, x, y, w, h, visi
}; };
}; };
function videoType1CreateVideoFulScreenAfterFunc(){
};
videoType1.prototype = new PageObject(); videoType1.prototype = new PageObject();
/* mediaType=1 and actionType = 2 Audio object : extends PageObject */ /* mediaType=1 and actionType = 2 Audio object : extends PageObject */
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
//名前空間用のオブジェクトを用意する //名前空間用のオブジェクトを用意する
var CONTENTVIEW_FILESYSTEM = {}; var CONTENTVIEW_FILESYSTEM = {};
CONTENTVIEW_FILESYSTEM.fs = null;
CONTENTVIEW_FILESYSTEM.isXhrBusy = false; CONTENTVIEW_FILESYSTEM.isXhrBusy = false;
//$(function () { //$(function () {
...@@ -18,6 +19,7 @@ CONTENTVIEW_FILESYSTEM.initFS = function( func ) { ...@@ -18,6 +19,7 @@ CONTENTVIEW_FILESYSTEM.initFS = function( func ) {
if( func != null ){ if( func != null ){
func(); func();
} }
return;
} }
window.requestFileSystem( window.requestFileSystem(
...@@ -116,7 +118,7 @@ CONTENTVIEW_FILESYSTEM.checkUpdate = function(contentId, data, func) { ...@@ -116,7 +118,7 @@ CONTENTVIEW_FILESYSTEM.checkUpdate = function(contentId, data, func) {
if (!CONTENTVIEW_FILESYSTEM.fs) { if (!CONTENTVIEW_FILESYSTEM.fs) {
console.log('CONTENTVIEW_FILESYSTEM.fs is null. id=' + contentId); console.log('CONTENTVIEW_FILESYSTEM.fs is null. id=' + contentId);
//おまじない ajaxカウントをインクリする必要有り //おまじない ajaxカウントをインクリする必要有り
nAjaxLoad++; //nAjaxLoad++;
//ファンクションがあれば実行 //ファンクションがあれば実行
if( func != null ){ if( func != null ){
func(data); func(data);
...@@ -324,9 +326,10 @@ CONTENTVIEW_FILESYSTEM.showVideoObjectCache = function(x, y, width, height, src, ...@@ -324,9 +326,10 @@ CONTENTVIEW_FILESYSTEM.showVideoObjectCache = function(x, y, width, height, src,
} else { } else {
if( this.readyState == 2 ){ if( this.readyState == 2 ){
console.log("onreadystatechange:" + this.readyState + " " + this.status);
$('#divImageLoading').css('display', 'block'); $('#divImageLoading').css('display', 'block');
CONTENTVIEW_FILESYSTEM.isXhrBusy = true;
} }
console.log("onreadystatechange:" + this.readyState + " " + this.status);
} }
} }
...@@ -334,7 +337,6 @@ CONTENTVIEW_FILESYSTEM.showVideoObjectCache = function(x, y, width, height, src, ...@@ -334,7 +337,6 @@ CONTENTVIEW_FILESYSTEM.showVideoObjectCache = function(x, y, width, height, src,
xhr.open('GET', src); xhr.open('GET', src);
xhr.responseType = 'blob'; xhr.responseType = 'blob';
xhr.send(); xhr.send();
CONTENTVIEW_FILESYSTEM.isXhrBusy = true;
} else { } else {
console.log("xhr is busy."); console.log("xhr is busy.");
} }
...@@ -371,6 +373,7 @@ CONTENTVIEW_FILESYSTEM.errorHandler = function(e) { ...@@ -371,6 +373,7 @@ CONTENTVIEW_FILESYSTEM.errorHandler = function(e) {
break; break;
}; };
//CONTENTVIEW_FILESYSTEM.fs = null; //CONTENTVIEW_FILESYSTEM.fs = null;
console.log('FileSystemAPI Error: ' + msg);
alert('FileSystemAPI Error: ' + msg); alert('FileSystemAPI Error: ' + msg);
}; };
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