<html>
<head>
    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
    <script type="text/javascript" src="https://ssl-webplayer.unity3d.com/download_webplayer-3.x/3.0/uo/UnityObject2.js"></script>
    <script type="text/javascript" src="http://ctinteractive.reallusion.com/ctinteractive/1.0/CTWebPlayer.min.js"></script>
    <script type="text/javascript">
        var player = new CTWebPlayer();
        $(function () {
            player.playerUrl = "http://www.reallusion.com/crazytalk/Unity/samplecode/CTWebPlayer.unity3d";
            player.init($("#unityPlayer"), function () {
                player.setCameraMode("telephoto");
                player.loadProject("http://www.reallusion.com/crazytalk/Unity/samplecode/SampleCode_Camera/Cute_Dog.uctProject", {
                    playAfter: -1,
                    idleMotionUrl: "http://www.reallusion.com/crazytalk/Unity/samplecode/SampleCode_Camera/Affirmative.uctidle",
                    loaded: function(){
                                    backToCenter();
                               }
                });
            });
        });

        function leftToRight(){
            player.actorTransform({
                scale: 100,
                positionX: 10,
                positionY: 47,
                duration: 0
            });
            player.actorTransform({
                scale: 100,
                positionX: 90,
                positionY: 47,
                duration: 10
            });
        }

        function backToCenter(){
            player.actorTransform({
                scale: 100,
                positionX:50,
                positionY:47,
                duration: 2,
            });
        }

        function Perspective1() {
            player.setCameraMode("telephoto");
        }

        function Perspective2() {
            player.setCameraMode("standard");
        }

        function Perspective3() {
            player.setCameraMode("wideAngle");
        }
    </script>
</head>

<body>
    <table style="text-align:center;margin-left:auto; margin-right:auto;">
        <tr>
            <td colspan=2>
                <div id="unityPlayer" style="width: 640px; height: 480px;">
                </div>
            </td>
        </tr>
        <tr>
            <td>
                <input type="button" value="Telephoto" onclick="Perspective1()" class="button" />
                <input type="button" value="Standard" onclick="Perspective2()" class="button" />
                <input type="button" value="Wide Angle" onclick="Perspective3()" class="button" />
            </td>
            <td>
                <input type="button" value="Move Character" onclick="leftToRight()" class="button" />
                <input type="button" value="Back to Center" onclick="backToCenter()" class="button" />
            </td>
        </tr>
    </table>
</body>
</html>