做个记录,字段自行对照解决
1.add.html
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Video')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="input-group">
<input id="c-video" class="form-control" size="50" name="row[video]" type="text">
<div class="input-group-addon no-border no-padding">
<span><button type="button" id="faupload-video" class="btn btn-danger faupload" data-input-id="c-video" data-mimetype="mp4,mp3,avi,flv,wmv" data-multiple="false" data-preview-id="p-video"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
<span><button type="button" id="fachoose-video" class="btn btn-primary fachoose" data-input-id="c-video" data-mimetype="mp4,mp3,avi,flv,wmv" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
</div>
<span class="msg-box n-right" for="c-image"></span>
</div>
<ul class="row list-inline faupload-preview" id="p-video"></ul>
</div>
</div>
2.edit.html
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Video')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="input-group">
<input id="c-video" class="form-control" size="50" name="row[video]" type="text" value="{$row.video|htmlentities}">
<div class="input-group-addon no-border no-padding">
<span><button type="button" id="faupload-video" class="btn btn-danger faupload" data-input-id="c-video" data-mimetype="mp4,mp3,avi,flv,wmv" data-multiple="false" data-preview-id="p-video"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
<span><button type="button" id="fachoose-video" class="btn btn-primary fachoose" data-input-id="c-video" data-mimetype="mp4,mp3,avi,flv,wmv" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
</div>
<span class="msg-box n-right" for="c-video"></span>
</div>
<ul class="row list-inline faupload-preview" id="p-video"></ul>
</div>
</div>
3.后台列表js
{field: 'video', title: __('Video'), operate: false,formatter:function (val,data) {
return '<video style="width: 200px;height: 140px" src="'+val+'" controls="controls"></video>';
}},
4.需要注意的地方
后台需要配置的地方可上传最大文件以及超时时间等问题自行查看链接
fastadmin后台上传视频