@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.
@@ -1,5 +1,5 @@
1
1
  import { ref as d, computed as y, openBlock as a, createElementBlock as n, createElementVNode as t, toDisplayString as s, withDirectives as c, Fragment as m, renderList as v, vModelSelect as p } from "vue";
2
- import { _ as b } from "./index-D8nDb3IQ.js";
2
+ import { _ as b } from "./index-DEJsbVgZ.js";
3
3
  const h = { class: "modal__contact-line" }, C = ["value"], D = { class: "modal__channel-line" }, S = ["value"], q = ["disabled"], k = {
4
4
  __name: "CreateDialog",
5
5
  props: {
@@ -0,0 +1,143 @@
1
+ import { defineComponent as N, ref as l, computed as z, onMounted as $, openBlock as m, createElementBlock as f, Fragment as q, createElementVNode as o, withDirectives as E, vShow as I, normalizeClass as g, createCommentVNode as y, toDisplayString as A, nextTick as G, unref as k } from "vue";
2
+ import { _ as H } from "./index-DEJsbVgZ.js";
3
+ const J = { class: "video-recorder__header" }, K = { class: "video-recorder__controls" }, P = { class: "video-recorder__recording-container" }, Q = { class: "video-recorder__recording-time" }, W = /* @__PURE__ */ N({
4
+ __name: "ModalVideoRecorder",
5
+ emits: ["change", "submit", "close"],
6
+ setup(X, { emit: L }) {
7
+ const S = l(), s = l(0), n = l(0), u = l(0), d = l(0), x = z(() => {
8
+ let a = d.value < 10 ? "0" + d.value : d.value, e = u.value < 10 ? "0" + u.value : u.value, t = n.value < 10 ? "0" + n.value : n.value, b = s.value < 10 ? "00" + s.value : s.value < 100 ? "0" + s.value : s.value;
9
+ return r.value ? a + ":" + e + ":" + t + ":" + b : " ";
10
+ }), _ = l(), R = l(), r = l(!1), c = l(), p = l(), V = l([]), i = l(), w = l(), v = l("camera"), F = () => {
11
+ v.value == "camera" ? (v.value = "screen", B()) : v.value == "screen" && (C(), v.value = "camera", M());
12
+ }, O = async () => {
13
+ !r.value && p.value instanceof MediaStream && (c.value = new MediaRecorder(p.value), c.value.start(), c.value.ondataavailable = (a) => {
14
+ V.value.push(a.data);
15
+ }, r.value = !0, S.value = setInterval(() => {
16
+ s.value += 10, s.value == 1e3 && (s.value = 0, n.value++, n.value == 60 && (n.value = 0, u.value++, u.value == 60 && (u.value = 0, d.value++)));
17
+ }, 10));
18
+ }, T = async () => {
19
+ D(), C(), i.value && (i.value = void 0, await M());
20
+ }, U = () => {
21
+ c.value && (c.value.stop(), c.value.onstop = async () => {
22
+ w.value = new File(V.value, "videomessage.mp4", { type: "video/*" });
23
+ const a = URL.createObjectURL(w.value);
24
+ i.value = a, G(() => {
25
+ R.value && (R.value.src = a);
26
+ });
27
+ }), D(), C();
28
+ };
29
+ function C() {
30
+ var e;
31
+ let a = (e = p.value) == null ? void 0 : e.getTracks();
32
+ a == null || a.forEach((t) => t.stop());
33
+ }
34
+ const D = () => {
35
+ clearInterval(S.value), s.value = 0, n.value = 0, u.value = 0, d.value = 0, r.value = !1, c.value = void 0, V.value = [];
36
+ }, h = L, j = () => {
37
+ h("change", { videoFile: w.value }), h("submit");
38
+ }, M = async () => {
39
+ await navigator.mediaDevices.getUserMedia({ audio: !0, video: !0 }).then((a) => {
40
+ const e = k(_.value);
41
+ p.value = a, e.srcObject = a, e.addEventListener("loadedmetadata", () => {
42
+ var t;
43
+ (t = k(_.value)) == null || t.play();
44
+ }), e.muted = !0;
45
+ });
46
+ }, B = async () => {
47
+ const a = {
48
+ video: {
49
+ cursor: "always"
50
+ },
51
+ audio: !1
52
+ };
53
+ await navigator.mediaDevices.getDisplayMedia(a).then((e) => {
54
+ const t = k(_.value);
55
+ p.value = e, t.srcObject = e, t.addEventListener("loadedmetadata", () => {
56
+ var b;
57
+ (b = k(_.value)) == null || b.play();
58
+ }), t.muted = !0;
59
+ });
60
+ };
61
+ return $(async () => {
62
+ await M();
63
+ }), (a, e) => (m(), f(q, null, [
64
+ o("div", J, [
65
+ o("button", {
66
+ class: "video-recorder__button video-recorder__button-close",
67
+ onClick: e[0] || (e[0] = (t) => h("close"))
68
+ }, e[1] || (e[1] = [
69
+ o("span", { class: "pi pi-times" }, null, -1)
70
+ ]))
71
+ ]),
72
+ o("div", null, [
73
+ E(o("video", {
74
+ class: "video-recorder__view-area",
75
+ ref_key: "refVideo",
76
+ ref: _
77
+ }, null, 512), [
78
+ [I, !i.value]
79
+ ]),
80
+ E(o("video", {
81
+ class: "video-recorder__view-area",
82
+ ref_key: "refRecord",
83
+ ref: R,
84
+ controls: ""
85
+ }, null, 512), [
86
+ [I, i.value]
87
+ ]),
88
+ o("div", K, [
89
+ o("div", P, [
90
+ !r.value && !i.value ? (m(), f("button", {
91
+ key: 0,
92
+ class: "video-recorder__button",
93
+ onClick: F
94
+ }, [
95
+ o("span", {
96
+ class: g({
97
+ "pi pi-desktop": v.value == "camera",
98
+ "pi pi-camera": v.value == "screen"
99
+ })
100
+ }, null, 2)
101
+ ])) : y("", !0),
102
+ i.value ? y("", !0) : (m(), f("button", {
103
+ key: 1,
104
+ class: g(["video-recorder__button", { "video-recorder__recording-button": r.value }]),
105
+ onClick: O
106
+ }, [
107
+ o("span", {
108
+ class: g(["pi", {
109
+ "pi-circle-fill video-recorder__recording-icon": r.value,
110
+ "pi-video": !r.value
111
+ }])
112
+ }, null, 2)
113
+ ], 2)),
114
+ !r.value && i.value ? (m(), f("button", {
115
+ key: 2,
116
+ class: "video-recorder__button",
117
+ onClick: T
118
+ }, e[2] || (e[2] = [
119
+ o("span", { class: "pi pi-trash" }, null, -1)
120
+ ]))) : y("", !0),
121
+ r.value ? (m(), f("button", {
122
+ key: 3,
123
+ class: "video-recorder__button",
124
+ onClick: U
125
+ }, e[3] || (e[3] = [
126
+ o("div", { class: "video-recorder__stop" }, null, -1)
127
+ ]))) : y("", !0),
128
+ o("span", Q, A(x.value), 1)
129
+ ]),
130
+ o("button", {
131
+ class: g(["video-recorder__button", { "video-recorder__button-disabled": !i.value }]),
132
+ onClick: j
133
+ }, e[4] || (e[4] = [
134
+ o("span", { class: "video-recorder__save-button" }, " Прикрепить видео ", -1)
135
+ ]), 2)
136
+ ])
137
+ ])
138
+ ], 64));
139
+ }
140
+ }), ee = /* @__PURE__ */ H(W, [["__scopeId", "data-v-6bf645f1"]]);
141
+ export {
142
+ ee as default
143
+ };
@@ -1,5 +1,5 @@
1
1
  import { ref as p, openBlock as n, createElementBlock as s, createElementVNode as t, toDisplayString as a, Fragment as m, renderList as _, withDirectives as h, vModelCheckbox as v } from "vue";
2
- import { _ as f } from "./index-D8nDb3IQ.js";
2
+ import { _ as f } from "./index-DEJsbVgZ.js";
3
3
  const g = { class: "participant-list" }, k = ["id", "value"], y = ["for"], x = {
4
4
  __name: "SelectUser2",
5
5
  props: {