@mobilon-dev/chotto 0.0.101 → 0.0.102

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mobilon-dev/chotto",
3
- "version": "0.0.101",
3
+ "version": "0.0.102",
4
4
  "type": "module",
5
5
  "main": "./dist/vuessages.umd.js",
6
6
  "module": "./dist/vuessages.es.js",
@@ -1,107 +0,0 @@
1
- import { defineComponent as T, ref as a, computed as j, onMounted as B, openBlock as c, createElementBlock as _, Fragment as N, createElementVNode as o, withDirectives as h, vShow as M, normalizeClass as R, createCommentVNode as y, toDisplayString as O, nextTick as z, unref as x } from "vue";
2
- import { _ as $ } from "./index-D8nDb3IQ.js";
3
- const q = { class: "video-recorder__header" }, A = { class: "video-recorder__controls" }, G = { class: "video-recorder__recording-container" }, H = { class: "video-recorder__recording-time" }, J = /* @__PURE__ */ T({
4
- __name: "ModalVideoRecorder",
5
- emits: ["change", "submit", "close"],
6
- setup(K, { emit: F }) {
7
- const V = a(), t = a(0), n = a(0), i = a(0), v = a(0), I = j(() => {
8
- let l = v.value < 10 ? "0" + v.value : v.value, e = i.value < 10 ? "0" + i.value : i.value, d = n.value < 10 ? "0" + n.value : n.value, S = t.value < 10 ? "00" + t.value : t.value < 100 ? "0" + t.value : t.value;
9
- return r.value ? l + ":" + e + ":" + d + ":" + S : " ";
10
- }), m = a(), p = a(), r = a(!1), u = a(), f = a(), b = a([]), s = a(), g = a(), L = async () => {
11
- r.value || (V.value = setInterval(() => {
12
- t.value += 10, t.value == 1e3 && (t.value = 0, n.value++, n.value == 60 && (n.value = 0, i.value++, i.value == 60 && (i.value = 0, v.value++)));
13
- }, 10), r.value = !0, f.value instanceof MediaStream && (u.value = new MediaRecorder(f.value), u.value.start(), u.value.ondataavailable = (l) => {
14
- b.value.push(l.data);
15
- }));
16
- }, U = async () => {
17
- C(), s.value && (s.value = void 0, await w());
18
- }, D = () => {
19
- u.value && (u.value.stop(), u.value.onstop = async () => {
20
- g.value = new File(b.value, "videomessage.mp4", { type: "video/*" });
21
- const l = URL.createObjectURL(g.value);
22
- s.value = l, z(() => {
23
- p.value && (p.value.src = l);
24
- });
25
- }), C();
26
- }, C = () => {
27
- clearInterval(V.value), t.value = 0, n.value = 0, i.value = 0, v.value = 0, r.value = !1, u.value = void 0, b.value = [];
28
- }, k = F, E = () => {
29
- k("change", { videoFile: g.value }), k("submit");
30
- }, w = async () => {
31
- await navigator.mediaDevices.getUserMedia({ audio: !0, video: !0 }).then((l) => {
32
- const e = x(m.value);
33
- f.value = l, e.srcObject = l, e.addEventListener("loadedmetadata", () => {
34
- var d;
35
- (d = x(m.value)) == null || d.play();
36
- }), e.muted = !0;
37
- });
38
- };
39
- return B(async () => {
40
- await w();
41
- }), (l, e) => (c(), _(N, null, [
42
- o("div", q, [
43
- o("button", {
44
- class: "video-recorder__button video-recorder__button-close",
45
- onClick: e[0] || (e[0] = (d) => k("close"))
46
- }, e[1] || (e[1] = [
47
- o("span", { class: "pi pi-times" }, null, -1)
48
- ]))
49
- ]),
50
- o("div", null, [
51
- h(o("video", {
52
- ref_key: "refVideo",
53
- ref: m
54
- }, null, 512), [
55
- [M, !s.value]
56
- ]),
57
- h(o("video", {
58
- ref_key: "refRecord",
59
- ref: p,
60
- controls: ""
61
- }, null, 512), [
62
- [M, s.value]
63
- ]),
64
- o("div", A, [
65
- o("div", G, [
66
- s.value ? y("", !0) : (c(), _("button", {
67
- key: 0,
68
- class: R(["video-recorder__button", { "video-recorder__recording-button": r.value }]),
69
- onClick: L
70
- }, [
71
- o("span", {
72
- class: R(["pi", {
73
- "pi-circle-fill video-recorder__recording-icon": r.value,
74
- "pi-video": !r.value
75
- }])
76
- }, null, 2)
77
- ], 2)),
78
- !r.value && s.value ? (c(), _("button", {
79
- key: 1,
80
- class: "video-recorder__button",
81
- onClick: U
82
- }, e[2] || (e[2] = [
83
- o("span", { class: "pi pi-trash" }, null, -1)
84
- ]))) : y("", !0),
85
- r.value ? (c(), _("button", {
86
- key: 2,
87
- class: "video-recorder__button",
88
- onClick: D
89
- }, e[3] || (e[3] = [
90
- o("div", { class: "video-recorder__stop" }, null, -1)
91
- ]))) : y("", !0),
92
- o("span", H, O(I.value), 1)
93
- ]),
94
- o("button", {
95
- class: R(["video-recorder__button", { "video-recorder__button-disabled": !s.value }]),
96
- onClick: E
97
- }, e[4] || (e[4] = [
98
- o("span", { class: "video-recorder__save-button" }, " Прикрепить видео ", -1)
99
- ]), 2)
100
- ])
101
- ])
102
- ], 64));
103
- }
104
- }), W = /* @__PURE__ */ $(J, [["__scopeId", "data-v-bcb51b3a"]]);
105
- export {
106
- W as default
107
- };