first commit
This commit is contained in:
@@ -0,0 +1,173 @@
|
||||
{% load static %}
|
||||
<!--load_static-->
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>视频</title>
|
||||
<!-- <link rel="stylesheet" href="plugins/bootstrap-3.4.1/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="css/video.css" type="text/css"/> -->
|
||||
<link rel="stylesheet" href="{% static 'plugins/bootstrap-3.4.1/css/bootstrap.min.css' %}">
|
||||
<link rel="stylesheet" href="{% static 'css/video2.css' %}" type="text/css"/>
|
||||
<!-- <script src="{% static 'js/jquery.min.js' %}" type="text/javascript"></script>-->
|
||||
<!-- <script src="{% static 'js/autoplay.js' %}" type="text/javascript"></script>-->
|
||||
<!-- <script src={% static 'js/jquery.validate.js' %}"></script>-->
|
||||
</head>
|
||||
<body>
|
||||
<div id="head">
|
||||
<div class="flex" >
|
||||
<div clsaa="logo"><img src="{% static 'img/logo.png' %}" /></div>
|
||||
<!-- <div class="logo fl"><img class="fl" src="img/logo.png" /></div> -->
|
||||
<div class="outlogin">
|
||||
<span class="outloga">用户姓名:</span>
|
||||
<a class="outloga">{{username}}</a>
|
||||
<a href="/account/logout/">退出登录</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="container">
|
||||
<div class="flex vat" >
|
||||
<div>
|
||||
<h1>数字分身任 我 创,专属数字人定制平台</h1>
|
||||
<h4>为各行各业提供从虚拟形象生成的多平台数字人解决方案,助力元宇宙生态搭建</h4>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content" >
|
||||
<div class="videobox fr">
|
||||
<form action="/account/video_create/" method="POST" target="targetIfr">
|
||||
{% csrf_token %}
|
||||
<button class="videobt fl" type="submit" id="videogenerate" onclick="hideElement()">开始视频合成</button>
|
||||
<!--<p><input type="submit" value="开始视频合成!"/></p >-->
|
||||
</form>
|
||||
<iframe name="targetIfr" style="display:none"></iframe>
|
||||
<br>
|
||||
<br>
|
||||
<h4>下载区域</h4>
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>文件名</th>
|
||||
<th>文件生成时间</th>
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
{% for file,time in file_list %}
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>{{ file }}</th>
|
||||
<th>{{ time }}</th>
|
||||
<td>
|
||||
<form method="post" action="{% url 'download' %}">
|
||||
<input type="text" style = "display:none" name="file" value="{{ file }}">
|
||||
{% csrf_token %}
|
||||
<button type="submit">下载</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
{% endfor %}
|
||||
</table>
|
||||
<button class="videowait fl" id="videogenerate2" style="display:none" onclick="myFunction()">视频正在合成,等待视频生成并加载</button>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="audiobox fl">
|
||||
<div>
|
||||
<form action="/account/sounds/" method="post">
|
||||
{% csrf_token %}
|
||||
<!--选择人物模型结束-->
|
||||
|
||||
<!--语音文字输入开始-->
|
||||
<br>
|
||||
<div >
|
||||
<label style="color:indianred" for="input1">输入文案生成语音</label>
|
||||
<textarea class="sourcetxt" id="input1" name="input1" onkeyup="countContent(this)">{{sounds_text}}</textarea>
|
||||
<span id="content_num">0</span>/<span>5000</span>
|
||||
</div>
|
||||
<br>
|
||||
<!--语音文字输入结束-->
|
||||
<!--选择人物模型开始-->
|
||||
<div class="asetbox">
|
||||
<label style="color:indianred" for="models">人物模型:</label>
|
||||
<select id="models" name="model" id="model-select">
|
||||
{% for model in models %}
|
||||
<option value="{{model}}">{{model}}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
|
||||
<!--选择语速开始-->
|
||||
<div class="rangebox fl">
|
||||
<!-- <label style="color:indianred" for="range">语速:</label>-->
|
||||
<!-- <input id="range" type="range" name="range" min="0" max="12" value={{range_speed}} defaultValue="9" onchange="document.getElementById('show').innerHTML=value/10"><span class="fr" id="show"></span>-->
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--选择语速结束-->
|
||||
<div class="abutbox">
|
||||
<button class="audiobt fl" type="submit">生成语音</button>
|
||||
<!--返回音频文件-->
|
||||
<audio class="audio-conbox fr" id="audioPlayer" controls>
|
||||
<source id="audioSource" src="" type="audio/wav">
|
||||
Your browser does not support the audio tag.
|
||||
</audio>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
// 获取在Django模板中传递的Base64编码音频数据
|
||||
let audioBase64Data = "{{ audio_data|safe }}";
|
||||
|
||||
// 获取audio标签
|
||||
let audioPlayer = document.getElementById('audioPlayer');
|
||||
let audioSource = document.getElementById('audioSource');
|
||||
|
||||
// 为source标签设置src属性
|
||||
audioSource.src = audioBase64Data;
|
||||
// 加载并可以播放音频
|
||||
audioPlayer.load();
|
||||
</script>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- <div style="margin-top: 2%">-->
|
||||
<!-- <a href="">关注我们了解更多</a>-->
|
||||
<!-- </div>-->
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
|
||||
function countContent(input) {
|
||||
// 获取要显示已经输入字数文本框对象
|
||||
var content = document.getElementById('content_num');
|
||||
|
||||
if (content && input) {
|
||||
// 获取输入框输入内容长度并更新到界面
|
||||
var value = input.value;
|
||||
// 将换行符不计算为单词数
|
||||
value = value.replace(/\n|\r/gi, "");
|
||||
// 更新计数
|
||||
content.innerText = value.length;
|
||||
}
|
||||
}
|
||||
function hideElement() {
|
||||
var element = document.getElementById("videogenerate"); // 根据id获取要隐藏的元素
|
||||
var element2 = document.getElementById("videogenerate2"); // 根据id获取要隐藏的元素
|
||||
if (element) {
|
||||
element.style.display = "none"; // 将元素的样式display属性设置为"none",从而隐藏元素
|
||||
element2.style.display = "inline"; // 将元素的样式display属性设置为"none",从而隐藏元素
|
||||
}
|
||||
}
|
||||
function myFunction(){
|
||||
alert("视频刷新成功!");
|
||||
var video = document.getElementById('zh_video');
|
||||
video.load();
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user