<!doctype html>

<head>
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
<title>{{title}}</title>

<style type="text/css">    
html,body{ width:100%; height:100%;}    
body {     
        margin-left: 0px;    
        margin-top: 0px;    
        margin-right: 0px;    
        margin-bottom: 0px;    
}

iframe{
    border: 0px;
}
</style> 
</head>

<body>
    <div id="lesson-document-content">
        <iframe id='viewerIframe' width='100%' allowfullscreen webkitallowfullscreen height='100%'></iframe>
    </div>
<script>
  var app = {};
  app.basePath = '';
  app.jsPaths = {"common":"common","theme":"\/themes\/default-b\/js","couponbundle":"\/bundles\/coupon\/js","questionplusbundle":"\/bundles\/questionplus\/js","vipbundle":"\/bundles\/vip\/js","customwebbundle":"\/bundles\/customweb\/js","customadminbundle":"\/bundles\/customadmin\/js"};

  app.mainScript = "{{ asset('bundles/topxiaweb/js/app.js') }}";
</script>

<script src="{{ asset('assets/libs/seajs/seajs/2.2.1/sea.js') }}"></script>
<script src="{{ asset('assets/libs/seajs-global-config.js') }}"></script>

<script>
seajs.use(app.mainScript, function(){
    seajs.use("/bundles/topxiaweb/js/controller/widget/document-player", function(DocumentPlayer){

        var player = new DocumentPlayer({
            element: '#lesson-document-content',
            swfFileUrl:'{{swfUri | raw}}',
            pdfFileUrl:'{{pdfUri | raw}}'
        });

        var clientHeight = document.body.clientHeight;
        $("#viewerIframe").height(clientHeight);
        window.onmessage=function(e){
            window.jsobj.toggleFullScreen();
            var isPageFullScreen = e.data;
            var docContent = document.getElementById("viewerIframe");
            if (isPageFullScreen) {
                docContent.style.height = clientHeight + "px";
            }else{
              var height = window.screen.height;
              docContent.style.height = height + "px";
            }
        };
    });
    
});

</script>

</body>
</html>