<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="https://www.reallusion.com/crazytalk/Unity/samplecode/CTWebPlayer.min.js"></script>
<script type="text/javascript">
var player = new CTWebPlayer();
$(function () {
player.playerUrl = "https://www.reallusion.com/crazytalk/Unity/samplecode/CTWebPlayer.unity3d";
player.init($("#unityPlayer"), function () {
player.loadProject("https://www.reallusion.com/crazytalk/Unity/samplecode/SampleCode17/Interaction_animation_callback.uctproject",
{
playAfter: 0,
idleMotionUrl:
"https://www.reallusion.com/crazytalk/Unity/samplecode/SampleCode17/Affirmative.uctidle"
});
player.bind( "playerstatus", function (event) {
if( event.status == "startplay" )
{
player.loadBackground("https://www.reallusion.com/crazytalk/Unity/samplecode/SampleCode17/image.jpg",
{
alpha: 1
});
}
else if( event.status == "playing" )
{
$("#labTime").text(event.time);
$("#labTotalTime").text(event.length);
}
else if( event.status == "pause" )
{
player.loadForeground("https://www.reallusion.com/crazytalk/Unity/samplecode/SampleCode17/logo.png",
{
action: "onClick();",
x: 0, y: 0, width: 20, height: 8,
hotspotX: 0, hotspotY: 0, hotspotWidth: 100, hotspotHeight: 100
});
}
else if( event.status == "stop" )
{
$("#labTime").text(event.time);
player.loadActor("https://www.reallusion.com/crazytalk/Unity/samplecode/SampleCode17/Interaction_animation_callback2.uctmodel");
player.loadScript("https://www.reallusion.com/crazytalk/Unity/samplecode/SampleCode17/Interaction_animation_callback2.uctscript");
}
});
});
});
function onClick() {
window.open('https://www.reallusion.com', '_blank');
}
</script>
</head>
<body>
<table style="text-align:center;margin-left:auto; margin-right:auto;">
<tr>
<td>
<div id="unityPlayer" style="width: 640px; height: 480px;">
</div>
</td>
</tr>
<tr>
<td>
Current Time:<label id="labTime" style="color:red"></label>
Total Time:<label id="labTotalTime" style="color:red"></label>
</td>
</tr>
</table>
</body>
</html>