wx.checkJsApi({
jsApiList: [“chooseMedia”],
success: function(i) {
i.checkResult.chooseMedia ? wx.invoke(“chooseMedia”, {
sourceType: “camera”,
mediaType: “video”,
maxDuration: l.default.videoOptions.wx.maxDuration,
camera: “front”
}, function(i) {
switch (c.log(“afterChooseMedia:” + document.cookie), i.err_msg) {
case “chooseMedia:fail_android_permission_denied”:
t(“noVideoPermission”), c.clickStat(“noVideoPermission”, “”, JSON.stringify(i));
break;
case “chooseMedia:ok”:
var o = i.localIds || i.localId;
try {
o = JSON.parse(o)
} catch (e) {}
if (“object” !== (void 0 === o ? “undefined” : n(o)) && (o = [i]), “1” == i.type)
if (1 == o.length) {
var a = o[0],
s = Number(a.duration),
r = Math.round(a.size / 1024),
p = a.localId;
s < l.default.videoOptions.wx.minDuration || s > l.default.videoOptions.wx.maxDuration + 1 ? (t(“shortException”), s < l.default.videoOptions.wx.minDuration ? c.clickStat(“shortException”, “”, “duration:” + s + “s;size:” + r + “kb;”) : c.clickStat(“longException”, “”, “duration:” + s + “s;size:” + r + “kb;”)) : Math.round(r / 1024) > 3 ? (t(“sizeException”), c.clickStat(“largeException”, “”, “duration:” + s + “s;size:” + r + “kb;”)) : (c.clickStat(“videoToUpload”, “”, “duration:” + s + “s;size:” + r + “kb;”), e§)
} else t(“chooseVideoException”), c.clickStat(“chooseVideoException”, “”, JSON.stringify(i));
else t(“chooseImageException”), c.clickStat(“chooseImageException”, “”, JSON.stringify(i));
break;
case “chooseMedia:cancel”:
t(“cancel”), c.clickStat(“chooseMediaCancel”);
break;
default:
t(“chooseVideoException”), c.setIsWeixin(!1), c.clickStat(“chooseVideoException”, “”, JSON.stringify(i))
}
}) : wx.invoke(“chooseVideo”, {
sourceType: “camera”,
maxDuration: l.default.videoOptions.wx.maxDuration,
camera: “front”
}, function(i) {
switch (i.err_msg) {
case “chooseVideo:ok”:
var n = Number(i.duration),
o = Math.round(i.size / 1024);
n < l.default.videoOptions.wx.minDuration || n > l.default.videoOptions.wx.maxDuration + 1 ? (t(“shortException”), n < l.default.videoOptions.wx.minDuration ? c.clickStat(“shortException”, “”, “duration:” + n + “s;size:” + o + “kb;”) : c.clickStat(“longException”, “”, “duration:” + n + “s;size:” + o + “kb;”)) : Math.round(o / 1024) > 3 ? (t(“sizeException”), c.clickStat(“largeException”, “”, “duration:” + n + “s;size:” + o + “kb;”)) : (c.clickStat(“videoToUpload”, “”, “duration:” + n + “s;size:” + o + “kb;”), e(i.localId));
break;
case “chooseVideo:cancel”:
t(“cancel”), c.clickStat(“chooseVideoCancel”);
break;
default:
t(“chooseVideoException”), c.clickStat(“chooseVideoException”, “”, JSON.stringify(i)), c.setIsWeixin(!1)
}
})
},
fail: function(e) {
t(“chooseVideoException”), c.clickStat(“checkJsApiException”, “”, JSON.stringify(e))
}
})