</div>
</div>
</label>
</form>
<van-button
round
block
type="info"
@click="subMit()"
>上传</van-button>
<iframe name="stop" ></iframe>
</div>
</template>
<script>
import $ from "jquery";
import { setInterval, clearInterval } from "timers";
import GIF from "../../static/js/gif.js";
export default {
data() {
return {
isShow: false,
videoSrc1: "",
File1: "",
videoSize1: "",
isAndroid1: false,
fileAndroid1: {},
winWidth1: window.innerWidth,
winHeight1: window.innerHeight,
gifSetTime1: false,
rip和ospf的区别gif1: ""
};
},
created() {
//判断终端
var u = navigator.userAgent;
var isAndroid = u.indexOf("Android") > -1 || u.indexOf("Adr") > -1; //android终端    var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
if (isAndroid) {
// console.log("isAndroid");
this.isAndroid = true;
} else if (isiOS) {
jquery下载文件请求
// console.log("isiOS");
this.isAndroid = false;
}
},
mounted() {
//初始gif
this.gif1 = new GIF({
workers: 1,
it培训费用多少
quality: 1000,
width: this.winWidth1,
height: this.winHeight1,
workerScript: "../../static/js/gif.worker.js"
});
},
methods: {
subMit() {
if (this.File1 !== "") {
$("#form1").submit();
}
},
changeVideo1(e) {
this.isshow1 = "none";
this.disPlay = "block";
this.isdisplay = "block";
var file = e.target.files[0];
/
/ console.log(file.name);
this.File1 = file.name;
// console.log(file);
// console.log(file);
const video = ElementById("myvideo1");
if (file !== undefined) {
//判断⾛向
if (this.isAndroid1) {
//视频开始播放
//视频播放完
python刷题网站
} else {
this.iphoneFile1(file);
}
}
},
//IOS拍摄视频
iphoneFile1(file) {
const that = this;
//视频字节⼤⼩
this.videoSize1 = file.size;
var url = null;
//file转换成blob
if (ateObjectURL != undefined) {
// basic
url = ateObjectURL(file);
} else if (window.URL != undefined) {
// mozilla(firefox)
url = ateObjectURL(file);
} else if (window.webkitURL != undefined) {
// webkit or chrome
url = ateObjectURL(file);
}
this.videoSrc1 = url;
if (file.size < 2100000 && file.size > 500000) {
this.uploadVideo1(file);
} else if (file.size >= 2100000) {
this.$("视频太⼤,请限制在10秒内");
} else {
this.$("视频录制不能少于5秒");
}
},
//安卓拍摄视频
androidFile1(file) {
//视频字节⼤⼩
this.videoSize1 = file.size;
//  this.videoSize = file.size;
const that = this;
const video = ElementById("myvideo1");
const canvas = ElementById("canvas1");
var context = Context("2d");
this.gifSetTime1 = true;
this.gif1.abort();
this.gif1.frames = [];
/
/file转base64
var reader = new FileReader();
that.videoSrc1 = sult;
video.play();
};
//视频开始播放
video.addEventListener("play", this.videoPlay1, false);
//视频播放完
video.addEventListener("ended", this.videoEnded1, false);
("finished", function(blob) {
if (that.fileAndroid1.size == blob.size) return;
// console.log("gif的blob⽂件", blob);
常用的php代码实例that.fileAndroid1 = vertBase64UrlToFile(blob);
霹雳兵烽决之碧血玄黄百度网盘

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。