Use app bundle JS for getting started video

This commit is contained in:
Tim Mickel 2016-01-22 16:44:46 -05:00
parent 2f2d36dd86
commit b102d7a100
2 changed files with 40 additions and 55 deletions

View file

@ -7,70 +7,19 @@
<head> <head>
<title>Junior</title> <title>Junior</title>
<script type="text/javascript" src="./Settings.js"></script>
<script type="text/javascript" src="jssource/utils/Cookie.js"></script>
<script type="text/javascript" src="jssource/utils/lib.js"></script>
<!-- Localization includes -->
<script type="text/javascript" src="jssource/external/Intl/Intl.min.js"></script>
<script type="text/javascript" src="jssource/external/intl-messageformat/intl-messageformat.min.js"></script>
<script type="text/javascript" src="jssource/utils/Localization.js"></script>
<script>
Localization.includeLocales();
</script>
<!-- End localization includes -->
<!-- In case we receive a project on this page -->
<script type="text/javascript" src="jssource/utils/DrawPath.js"></script>
<script type="text/javascript" src="jssource/editor/ui/Alert.js"></script>
<script type="text/javascript" src="jssource/iPad/iOS.js"></script>
<script type="text/javascript" src="jssource/iPad/IO.js"></script>
<script type="text/javascript" src="./MediaLib.js"></script>
<script type="text/javascript" src="jssource/external/jszip.js"></script>
<script>
preprocessAndLoadCss("css", "css/font.css");
preprocessAndLoadCss("css", "css/base.css");
preprocessAndLoadCss("css", "css/gs.css");
</script>
<script language="javascript"> <script language="javascript">
window.scratchJrPage = 'gettingStarted';
var place;
function tutorialScratchJr(){
var urlvars = getUrlVars();
place = urlvars['place'];
document.ontouchmove = function(e){e.preventDefault()};
}
function closeme (){
window.location.href = "home.html?place=" + place;
}
</script> </script>
<script type="text/javascript" src="jssource/build/bundles/app.bundle.js"></script>
</head> </head>
<body onload="iOS.waitForInterface(tutorialScratchJr);"> <body>
<div class="tutorial" id="tutorialmode"> <div class="tutorial" id="tutorialmode">
<div class="closehelp" onclick="closeme()" ontouchstart="closeme()"></div> <div class="closehelp" id="closeHelp"></div>
<div class="introvideocontainer"> <div class="introvideocontainer">
<video class="introvideo" id="myVideo" controls></video> <video class="introvideo" id="myVideo" controls></video>
</div> </div>
</div> </div>
<script>
var videoObj = document.getElementById("myVideo");
if (isiOS) {
// On iOS we can load from server
videoObj.src = "assets/lobby/intro.mp4";
} else {
// On Android we need to copy to a temporary directory first:
setTimeout(function() {
videoObj.type = "video/mp4";
videoObj.src = AndroidInterface.scratchjr_getgettingstartedvideopath();
}, 1000);
}
videoObj.poster = "assets/lobby/poster.png";
</script>
</body> </body>
</html> </html>

View file

@ -128,6 +128,35 @@ function loadSettings (whenDone) {
}); });
} }
// Previously gettingstarted.html
let place;
function gettingStartedVideo () {
var videoObj = gn('myVideo');
if (isiOS) {
// On iOS we can load from server
videoObj.src = 'assets/lobby/intro.mp4';
} else {
// On Android we need to copy to a temporary directory first:
setTimeout(function () {
videoObj.type = 'video/mp4';
videoObj.src = AndroidInterface.scratchjr_getgettingstartedvideopath();
}, 1000);
}
videoObj.poster = 'assets/lobby/poster.png';
var urlvars = getUrlVars();
place = urlvars['place'];
document.ontouchmove = function (e){
e.preventDefault();
};
}
function gettingStartedCloseMe () {
window.location.href = 'home.html?place=' + place;
}
// App-wide entry-point // App-wide entry-point
window.onload = () => { window.onload = () => {
// Load settings from JSON // Load settings from JSON
@ -163,6 +192,13 @@ window.onload = () => {
preprocessAndLoadCss('css', 'css/librarymodal.css'); preprocessAndLoadCss('css', 'css/librarymodal.css');
preprocessAndLoadCss('css', 'css/paintlook.css'); preprocessAndLoadCss('css', 'css/paintlook.css');
iOS.waitForInterface(editorCreateScratchJr); iOS.waitForInterface(editorCreateScratchJr);
} else if (page == 'gettingStarted') {
preprocessAndLoadCss('css', 'css/font.css');
preprocessAndLoadCss('css', 'css/base.css');
preprocessAndLoadCss('css', 'css/gs.css');
gn('closeHelp').onclick = gettingStartedCloseMe;
gn('closeHelp').ontouchstart = gettingStartedCloseMe;
iOS.waitForInterface(gettingStartedVideo);
} }
}); });
}); });