Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
check
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abook_web
check
Commits
69fb9ed6
Commit
69fb9ed6
authored
Dec 12, 2014
by
Masaru Abe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
パフォーマンス改善 JS暗号化エラー対応
parent
999c601a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
91 additions
and
130 deletions
+91
-130
abvw/js/contentview_CreateObjects.js
+85
-127
abvw/js/contentview_FileSystem.js
+6
-3
No files found.
abvw/js/contentview_CreateObjects.js
View file @
69fb9ed6
/// <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 --------------------------------*/
...
...
@@ -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
.
action
=
function
()
{
//abe
//alert("videoType2:" + getPageIndex());
//詳細ログ作成
...
...
@@ -1391,40 +1383,23 @@ 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();
//
//});
console
.
log
(
"aaaaa"
);
$
(
"#btnCloseVideo"
).
on
({
'click'
:
function
(){
'click touchend'
:
function
(
ev
){
console
.
log
(
"#btnCloseVideo click touchend"
);
//時間記録
hideDialog
();
/*play audio if exist */
playAllAudio
();
return
false
;
},
'touchstart'
:
function
(){
console
.
log
(
"touchstart"
);
},
'touchmove'
:
function
(){
console
.
log
(
"touchmove"
);
},
'touchend'
:
function
(){
console
.
log
(
"touchend"
);
//時間記録
hideDialog
();
/*play audio if exist */
playAllAudio
();
'touchstart touchmove'
:
function
(){
//これを入れないと次にダイアログを開くと表示位置が大きくズレる
//console.log("#btnCloseVideo touchstart touchmove");
return
false
;
}
});
showDialog
(
true
);
}
else
{
//キャッシュが存在するか確認
...
...
@@ -1438,15 +1413,6 @@ var videoType2 = function (mediaType, actionType, id, imageUrl, x, y, w, h, visi
console
.
log
(
"read cache: createObjectURL "
+
resSrc
);
createVideoFulScreen
(
resSrc
,
id
);
//$("#btnCloseVideo").click(function (e) {
// //時間記録
// hideDialog();
// /*play audio if exist */
// playAllAudio();
//
//});
console
.
log
(
"bbbbbb"
);
$
(
"#btnCloseVideo"
).
on
({
'click touchend'
:
function
(
ev
){
console
.
log
(
"#btnCloseVideo click touchend"
);
...
...
@@ -1458,11 +1424,11 @@ var videoType2 = function (mediaType, actionType, id, imageUrl, x, y, w, h, visi
},
'touchstart touchmove'
:
function
(){
//これを入れないと次にダイアログを開くと表示位置が大きくズレる
console
.
log
(
"#btnCloseVideo touchstart touchmove"
);
//
console.log("#btnCloseVideo touchstart touchmove");
return
false
;
}
});
showDialog
(
true
);
}
...
...
@@ -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([this.response], {type:"video/mp4"});
fileWriter
.
write
(
blobData
);
}
...
...
@@ -1506,11 +1471,12 @@ var videoType2 = function (mediaType, actionType, id, imageUrl, x, y, w, h, visi
}
else
{
if
(
this
.
readyState
==
2
){
console
.
log
(
"onreadystatechange:"
+
this
.
readyState
+
" "
+
this
.
status
);
CONTENTVIEW_FILESYSTEM
.
isXhrBusy
=
true
;
$
(
'#divImageLoading'
).
css
(
'z-index'
,
'99999'
);
$
(
'#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
xhr
.
open
(
'GET'
,
mediaFile
);
xhr
.
responseType
=
'blob'
;
xhr
.
send
();
CONTENTVIEW_FILESYSTEM
.
isXhrBusy
=
true
;
}
else
{
console
.
log
(
"xhr is busy."
);
}
//タグは書き出し
createVideoFulScreen
(
mediaFile
,
id
);
$
(
"#btnCloseVideo"
).
click
(
function
(
e
)
{
//時間記録
hideDialog
();
/*play audio if exist */
playAllAudio
();
});
$
(
"#btnCloseVideo"
).
on
({
'click touchend'
:
function
(
ev
){
console
.
log
(
"#btnCloseVideo click touchend"
);
//時間記録
hideDialog
();
/*play audio if exist */
playAllAudio
();
return
false
;
},
'touchstart touchmove'
:
function
(){
//これを入れないと次にダイアログを開くと表示位置が大きくズレる
//console.log("#btnCloseVideo touchstart touchmove");
return
false
;
}
});
showDialog
(
true
);
}
...
...
@@ -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
();
/* mediaType = 1 and actionType = 0 linkURL object*/
...
...
@@ -1612,15 +1561,23 @@ 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
();
$
(
"#btnCloseVideo"
).
on
({
'click touchend'
:
function
(
ev
){
console
.
log
(
"#btnCloseVideo click touchend"
);
//時間記録
var
dateEnd
=
new
Date
();
var
actionTime
=
dateEnd
.
subtractBySeconds
(
dateStart
);
SetObjectLogActionTime
(
contentID
,
objectId
,
actionTime
);
hideDialog
();
/* play audio */
playAllAudio
();
return
false
;
},
'touchstart touchmove'
:
function
(){
//これを入れないと次にダイアログを開くと表示位置が大きくズレる
//console.log("#btnCloseVideo touchstart touchmove");
return
false
;
}
});
showDialog
(
true
);
...
...
@@ -1638,17 +1595,26 @@ var videoType1 = function (mediaType, actionType, id, imageUrl, x, y, w, h, visi
//タグは書き出し
createVideoFulScreen
(
resSrc
,
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
);
$
(
"#btnCloseVideo"
).
on
({
'click touchend'
:
function
(
ev
){
console
.
log
(
"#btnCloseVideo click touchend"
);
//時間記録
var
dateEnd
=
new
Date
();
var
actionTime
=
dateEnd
.
subtractBySeconds
(
dateStart
);
//alert("actionTime:" + actionTime);
SetObjectLogActionTime
(
contentID
,
objectId
,
actionTime
);
hideDialog
();
/* play audio */
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
);
}
else
{
console
.
log
(
"onreadystatechange:"
+
this
.
readyState
+
" "
+
this
.
status
);
if
(
this
.
readyState
==
2
){
console
.
log
(
"onreadystatechange:"
+
this
.
readyState
+
" "
+
this
.
status
);
CONTENTVIEW_FILESYSTEM
.
isXhrBusy
=
true
;
$
(
'#divImageLoading'
).
css
(
'z-index'
,
'99999'
);
$
(
'#divImageLoading'
).
css
(
'display'
,
'block'
);
}
...
...
@@ -1702,22 +1669,30 @@ var videoType1 = function (mediaType, actionType, id, imageUrl, x, y, w, h, visi
xhr
.
open
(
'GET'
,
mediaFile
);
xhr
.
responseType
=
'blob'
;
xhr
.
send
();
CONTENTVIEW_FILESYSTEM
.
isXhrBusy
=
true
;
}
else
{
console
.
log
(
"xhr is busy."
);
}
//タグは書き出し
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
();
$
(
"#btnCloseVideo"
).
on
({
'click touchend'
:
function
(
ev
){
console
.
log
(
"#btnCloseVideo click touchend"
);
//時間記録
var
dateEnd
=
new
Date
();
var
actionTime
=
dateEnd
.
subtractBySeconds
(
dateStart
);
//alert("actionTime:" + actionTime);
SetObjectLogActionTime
(
contentID
,
objectId
,
actionTime
);
hideDialog
();
/* play audio */
playAllAudio
();
return
false
;
},
'touchstart touchmove'
:
function
(){
//これを入れないと次にダイアログを開くと表示位置が大きくズレる
//console.log("#btnCloseVideo touchstart touchmove");
return
false
;
}
});
showDialog
(
true
);
...
...
@@ -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
};
};
function
videoType1CreateVideoFulScreenAfterFunc
(){
};
videoType1
.
prototype
=
new
PageObject
();
/* mediaType=1 and actionType = 2 Audio object : extends PageObject */
...
...
abvw/js/contentview_FileSystem.js
View file @
69fb9ed6
...
...
@@ -2,6 +2,7 @@
//名前空間用のオブジェクトを用意する
var
CONTENTVIEW_FILESYSTEM
=
{};
CONTENTVIEW_FILESYSTEM
.
fs
=
null
;
CONTENTVIEW_FILESYSTEM
.
isXhrBusy
=
false
;
//$(function () {
...
...
@@ -18,6 +19,7 @@ CONTENTVIEW_FILESYSTEM.initFS = function( func ) {
if
(
func
!=
null
){
func
();
}
return
;
}
window
.
requestFileSystem
(
...
...
@@ -116,7 +118,7 @@ CONTENTVIEW_FILESYSTEM.checkUpdate = function(contentId, data, func) {
if
(
!
CONTENTVIEW_FILESYSTEM
.
fs
)
{
console
.
log
(
'CONTENTVIEW_FILESYSTEM.fs is null. id='
+
contentId
);
//おまじない ajaxカウントをインクリする必要有り
nAjaxLoad
++
;
//
nAjaxLoad++;
//ファンクションがあれば実行
if
(
func
!=
null
){
func
(
data
);
...
...
@@ -324,9 +326,10 @@ CONTENTVIEW_FILESYSTEM.showVideoObjectCache = function(x, y, width, height, src,
}
else
{
if
(
this
.
readyState
==
2
){
console
.
log
(
"onreadystatechange:"
+
this
.
readyState
+
" "
+
this
.
status
);
$
(
'#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,
xhr
.
open
(
'GET'
,
src
);
xhr
.
responseType
=
'blob'
;
xhr
.
send
();
CONTENTVIEW_FILESYSTEM
.
isXhrBusy
=
true
;
}
else
{
console
.
log
(
"xhr is busy."
);
}
...
...
@@ -371,6 +373,7 @@ CONTENTVIEW_FILESYSTEM.errorHandler = function(e) {
break
;
};
//CONTENTVIEW_FILESYSTEM.fs = null;
console
.
log
(
'FileSystemAPI Error: '
+
msg
);
alert
(
'FileSystemAPI Error: '
+
msg
);
};
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment