mirror of
https://github.com/scratchfoundation/scratchjr.git
synced 2025-02-17 17:01:12 -05:00
Merge pull request #436 from yueyuzhao/issue/388-video-poster
show video after poster image is loaded
This commit is contained in:
commit
fdf974616e
2 changed files with 7 additions and 3 deletions
|
@ -18,7 +18,7 @@
|
|||
<div class="tutorial" id="tutorialmode">
|
||||
<div class="closehelp" id="closeHelp"></div>
|
||||
<div class="introvideocontainer">
|
||||
<video class="introvideo" id="myVideo" controls></video>
|
||||
<video class="introvideo" id="myVideo" controls style="display: none;"></video>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
|
|
@ -6,6 +6,12 @@ export function gettingStartedMain () {
|
|||
gn('closeHelp').onclick = gettingStartedCloseMe;
|
||||
gn('closeHelp').ontouchstart = gettingStartedCloseMe;
|
||||
var videoObj = gn('myVideo');
|
||||
videoObj.poster = 'assets/lobby/poster.png';
|
||||
var image = document.createElement('img');
|
||||
image.src = videoObj.poster;
|
||||
image.onload = function () {
|
||||
videoObj.style.display = 'block';
|
||||
};
|
||||
if (isiOS) {
|
||||
// On iOS we can load from server
|
||||
videoObj.src = 'assets/lobby/intro.mp4';
|
||||
|
@ -16,8 +22,6 @@ export function gettingStartedMain () {
|
|||
videoObj.src = AndroidInterface.scratchjr_getgettingstartedvideopath();
|
||||
}, 1000);
|
||||
}
|
||||
videoObj.poster = 'assets/lobby/poster.png';
|
||||
|
||||
var urlvars = getUrlVars();
|
||||
place = urlvars['place'];
|
||||
document.ontouchmove = function (e) {
|
||||
|
|
Loading…
Reference in a new issue