Skip to content

Commit

Permalink
Bug fix for textVideo.rlm - problem with video not returning to corre…
Browse files Browse the repository at this point in the history
…ct dimensions after viewing it full screen

git-svn-id: https://xerteonlinetoolkits.googlecode.com/svn/trunk@244 912cdd6b-5c7d-d5a7-a2ba-d0f0cdb91641
  • Loading branch information
FayCross committed Jan 4, 2012
1 parent 2c5749f commit 14590a7
Showing 1 changed file with 1 addition and 153 deletions.
154 changes: 1 addition & 153 deletions modules/xerte/parent_templates/Nottingham/models/textVideo.rlm
@@ -1,153 +1 @@
<PG title="enter page title" name="textVideo">
<SCR name="getPageID"><![CDATA[pageIcon = icon.parentNode.clip();

if (extXML == undefined){
// Page Wizard
pageIcon.templateData = pageIcon.extXML.toObject();
pageIcon.templateData = pageIcon.templateData.pageWizard[0];
} else {
// Toolkits
myXML = new XML(extXML.firstChild.childNodes[rootIcon.getPageIndex() - pgOffset]);
pageIcon.templateData = myXML.toObject();
rootIcon.setTitleText(templateData.learningObject[0].name);
}

//size the movie
if (pageIcon.templateData.textVideo[0].movieSize != undefined){
icon.parentNode.getChildByName('movie').attributes.w = pageIcon.templateData.textVideo[0].movieSize.split(',')[0];
icon.parentNode.getChildByName('movie').attributes.h = pageIcon.templateData.textVideo[0].movieSize.split(',')[1];
}

vidURL = pageIcon.templateData.textVideo[0].url;
//support for links from moletv
if (vidURL.indexOf('moletv.org.uk') != -1){
vid = vidURL.split('=')[1];
vidURL = "'http://www.moletv.org.uk/mod/FileStream.aspx?v=" + vid + "&t=1&z=.flv'"
}


if (pageIcon.templateData.textVideo[0].narration != undefined){
narration = pageIcon.templateData.textVideo[0].narration;
rootIcon.broadcast('showAudio');
}
fullScreen = false;



]]></SCR>
<DIS tabIndex="-1" id="panel" name="panel" x="-300" y="20" type="ext" url="templatePath + 'common/whitePanel.swf'"><![CDATA[]]></DIS>
<INT name="loadPanel" perpetual="0">
<RES name="onLoad" type="event" eventName="onLoad" icon="panel" erase="1" exit="1">
<SCR name="calculate"><![CDATA[//ok to move on



]]></SCR>
</RES>
</INT>
<MOV id="movie" name="movie" x="0" y="30" url="{vidURL}" controls="1" play="0"><![CDATA[{pageIcon.templateData.textVideo[0].tip}]]></MOV>
<INT name="loadVideo" perpetual="0">
<RES name="onMovieReady" type="event" eventName="onMovieReady" icon="movie" erase="1" exit="1">
<SCR name="calculate"><![CDATA[//resize the panel to the graphic
panel._width = movie._width + 20;
panel._height = movie._height + 40;

if (pageIcon.templateData.textVideo[0].align == 'Left'){
panel._x = stageWidth - panel._width - 20;
movie._x = panel._x + 10;
textX = 20;
} else {
panel._x = 20;
movie._x = 30;
textX = panel._width + 40;
}
textWidth = stageWidth - 60 - panel._width;

if (pageIcon.templateData.textVideo[0].reset == 'false'){
movie.flvPlayer.autoRewind = false;
}

initW = movie._width;
initH = movie._height;
initX = movie._x;
initY = movie._y;]]></SCR>
</RES>
</INT>
<DIS id="textBlock" scrolling="auto" name="text" x="textX" y="20" w="textWidth" h="480" type="text"><![CDATA[{pageIcon.templateData.textVideo[0]}]]></DIS>
<INT name="[Untitled]" perpetual="1">
<RES rs="btnToggle" swf="templatePath + 'common/zoom.png'" name="toggle" type="button" x="movie._x + movie._width - 20" y="movie._y + movie._height + 2" label="label" erase="1" exit="0">
<SCR name="[Untitled]"><![CDATA[if (fullScreen == false){

fullScreen = true;
movie.setSize(800,434);
textBlock._visible = false;

} else {

fullScreen = false;
movie.setSize(initWidth,initH);
textBlock._visible = true;
}
]]></SCR>
</RES>
<RES name="onResize" type="event" eventName="onResize" icon="movie" erase="1" exit="0">
<SCR name="[Untitled]"><![CDATA[if (fullScreen == true){

movie._x = 400 - movie._width / 2;

panel._x = movie._x - 10;
panel._y = movie._y - 10;
panel._width = movie._width + 20;
panel._height = movie._height +40;

btnToggle._x = movie._x + movie._width - 20;
btnToggle._y = movie._y + movie._height + 2;

} else {

movie._x = initX;
movie._y = initY;

panel._x = movie._x - 10;
panel._y = movie._y - 10;
panel._width = initW + 20;
panel._height = initH +40;


btnToggle._x = initX + initW - 20;
btnToggle._y = initY + initH + 2;
}


]]></SCR>
</RES>
</INT>
<SCR name="setupTranscript"><![CDATA[if (pageIcon.templateData.textVideo[0].transcript == undefined){
icon.nextSibling.removeNode();
}

]]></SCR>
<INT id="trans" name="transcript" perpetual="0">
<RES w="90" swf="templatePath + 'common/invertTab.swf'" rs="btnTrans" name="showTranscript" type="button" x="panel._x + panel._width - 100" y="panel._y + panel._height" label="transcript" erase="1" exit="0">
<SCR name="tween"><![CDATA[if (transShow != true){
panel.tween("_height", panel._height, 464,0.2,'Strong', 'easeIn');
btnTrans.tween("_y", btnTrans._y, 484,0.2,'Strong', 'easeIn');
transShow = true;
} else {
panel.tween("_height", panel._height, movie._height + 30,0.2,'Strong', 'easeIn');
btnTrans.tween("_y", btnTrans._y, movie._y + movie._height + 20,0.2,'Strong', 'easeIn');
transShow = false;
}

]]></SCR>
</RES>
<RES name="onMotionFinished" type="event" eventName="onMotionFinished" icon="panel" erase="1" exit="0">
<SCR name="broadcast"><![CDATA[if (transShow == true){
trans.broadcast("showTranscript");
}]]></SCR>
</RES>
<RES name="showTranscript" type="event" eventName="showTranscript" icon="trans" erase="1" exit="0">
<DIS textColour="#333333" scrolling="auto" name="transcript" x="movie._x" y="movie._y + movie._height" w="movie._width" h="panel._height - movie._height - 20" type="text"><![CDATA[{pageIcon.templateData.textVideo[0].transcript}]]></DIS>
</RES>
</INT>
</PG>
<PG title="enter page title" name="textVideo"> <SCR name="getPageID"><![CDATA[pageIcon = icon.parentNode.clip();if (extXML == undefined){ // Page Wizard pageIcon.templateData = pageIcon.extXML.toObject(); pageIcon.templateData = pageIcon.templateData.pageWizard[0];} else { // Toolkits myXML = new XML(extXML.firstChild.childNodes[rootIcon.getPageIndex() - pgOffset]); pageIcon.templateData = myXML.toObject(); rootIcon.setTitleText(templateData.learningObject[0].name);}//size the movieif (pageIcon.templateData.textVideo[0].movieSize != undefined){ icon.parentNode.getChildByName('movie').attributes.w = pageIcon.templateData.textVideo[0].movieSize.split(',')[0]; icon.parentNode.getChildByName('movie').attributes.h = pageIcon.templateData.textVideo[0].movieSize.split(',')[1];}vidURL = pageIcon.templateData.textVideo[0].url;//support for links from moletvif (vidURL.indexOf('moletv.org.uk') != -1){ vid = vidURL.split('=')[1]; vidURL = "'http://www.moletv.org.uk/mod/FileStream.aspx?v=" + vid + "&t=1&z=.flv'"}if (pageIcon.templateData.textVideo[0].narration != undefined){ narration = pageIcon.templateData.textVideo[0].narration; rootIcon.broadcast('showAudio');}fullScreen = false;]]></SCR> <DIS tabIndex="-1" id="panel" name="panel" x="-300" y="20" type="ext" url="templatePath + 'common/whitePanel.swf'"><![CDATA[]]></DIS> <INT name="loadPanel" perpetual="0"> <RES name="onLoad" type="event" eventName="onLoad" icon="panel" erase="1" exit="1"> <SCR name="calculate"><![CDATA[//ok to move on]]></SCR> </RES> </INT> <MOV id="movie" name="movie" x="0" y="30" url="{vidURL}" controls="1" play="0"><![CDATA[{pageIcon.templateData.textVideo[0].tip}]]></MOV> <INT name="loadVideo" perpetual="0"> <RES name="onMovieReady" type="event" eventName="onMovieReady" icon="movie" erase="1" exit="1"> <SCR name="calculate"><![CDATA[//resize the panel to the graphicpanel._width = movie._width + 20;panel._height = movie._height + 40;if (pageIcon.templateData.textVideo[0].align == 'Left'){ panel._x = stageWidth - panel._width - 20; movie._x = panel._x + 10; textX = 20;} else { panel._x = 20; movie._x = 30; textX = panel._width + 40;}textWidth = stageWidth - 60 - panel._width;if (pageIcon.templateData.textVideo[0].reset == 'false'){ movie.flvPlayer.autoRewind = false;}initW = movie._width;initH = movie._height;initX = movie._x;initY = movie._y;]]></SCR> </RES> </INT> <DIS id="textBlock" scrolling="auto" name="text" x="textX" y="20" w="textWidth" h="480" type="text"><![CDATA[{pageIcon.templateData.textVideo[0]}]]></DIS> <INT name="[Untitled]" perpetual="1"> <RES rs="btnToggle" swf="templatePath + 'common/zoom.png'" name="toggle" type="button" x="movie._x + movie._width - 20" y="movie._y + movie._height + 2" label="label" erase="1" exit="0"> <SCR name="[Untitled]"><![CDATA[if (fullScreen == false){ fullScreen = true; movie.setSize(800,434); textBlock._visible = false; } else { fullScreen = false; movie.setSize(initW,initH); textBlock._visible = true;}]]></SCR> </RES> <RES name="onResize" type="event" eventName="onResize" icon="movie" erase="1" exit="0"> <SCR name="[Untitled]"><![CDATA[if (fullScreen == true){ movie._x = 400 - movie._width / 2; panel._x = movie._x - 10; panel._y = movie._y - 10; panel._width = movie._width + 20; panel._height = movie._height +40; btnToggle._x = movie._x + movie._width - 20; btnToggle._y = movie._y + movie._height + 2;} else { movie._x = initX; movie._y = initY; panel._x = movie._x - 10; panel._y = movie._y - 10; panel._width = initW + 20; panel._height = initH +40; btnToggle._x = initX + initW - 20; btnToggle._y = initY + initH + 2;}]]></SCR> </RES> </INT> <SCR name="setupTranscript"><![CDATA[if (pageIcon.templateData.textVideo[0].transcript == undefined){ icon.nextSibling.removeNode();}]]></SCR> <INT id="trans" name="transcript" perpetual="0"> <RES w="90" swf="templatePath + 'common/invertTab.swf'" rs="btnTrans" name="showTranscript" type="button" x="panel._x + panel._width - 100" y="panel._y + panel._height" label="transcript" erase="1" exit="0"> <SCR name="tween"><![CDATA[if (transShow != true){ panel.tween("_height", panel._height, 464,0.2,'Strong', 'easeIn'); btnTrans.tween("_y", btnTrans._y, 484,0.2,'Strong', 'easeIn'); transShow = true;} else { panel.tween("_height", panel._height, movie._height + 30,0.2,'Strong', 'easeIn'); btnTrans.tween("_y", btnTrans._y, movie._y + movie._height + 20,0.2,'Strong', 'easeIn'); transShow = false;}]]></SCR> </RES> <RES name="onMotionFinished" type="event" eventName="onMotionFinished" icon="panel" erase="1" exit="0"> <SCR name="broadcast"><![CDATA[if (transShow == true){ trans.broadcast("showTranscript");}]]></SCR> </RES> <RES name="showTranscript" type="event" eventName="showTranscript" icon="trans" erase="1" exit="0"> <DIS textColour="#333333" scrolling="auto" name="transcript" x="movie._x" y="movie._y + movie._height" w="movie._width" h="panel._height - movie._height - 20" type="text"><![CDATA[{pageIcon.templateData.textVideo[0].transcript}]]></DIS> </RES> </INT> </PG>
Expand Down

0 comments on commit 14590a7

Please sign in to comment.