tavi-video-tutor 0.1.0

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.
@@ -0,0 +1,121 @@
1
+ import { i as e, t } from "./chunk-jwUa06l-.js";
2
+ import { n, t as r } from "./ai-tutor.js";
3
+ //#region node_modules/react-player/lib/players/Vimeo.js
4
+ var i = /* @__PURE__ */ t(((t, i) => {
5
+ var a = Object.create, o = Object.defineProperty, s = Object.getOwnPropertyDescriptor, c = Object.getOwnPropertyNames, l = Object.getPrototypeOf, u = Object.prototype.hasOwnProperty, d = (e, t, n) => t in e ? o(e, t, {
6
+ enumerable: !0,
7
+ configurable: !0,
8
+ writable: !0,
9
+ value: n
10
+ }) : e[t] = n, f = (e, t) => {
11
+ for (var n in t) o(e, n, {
12
+ get: t[n],
13
+ enumerable: !0
14
+ });
15
+ }, p = (e, t, n, r) => {
16
+ if (t && typeof t == "object" || typeof t == "function") for (let i of c(t)) !u.call(e, i) && i !== n && o(e, i, {
17
+ get: () => t[i],
18
+ enumerable: !(r = s(t, i)) || r.enumerable
19
+ });
20
+ return e;
21
+ }, m = (e, t, n) => (n = e == null ? {} : a(l(e)), p(t || !e || !e.__esModule ? o(n, "default", {
22
+ value: e,
23
+ enumerable: !0
24
+ }) : n, e)), h = (e) => p(o({}, "__esModule", { value: !0 }), e), g = (e, t, n) => (d(e, typeof t == "symbol" ? t : t + "", n), n), _ = {};
25
+ f(_, { default: () => w }), i.exports = h(_);
26
+ var v = m(e("react")), y = n(), b = r(), x = "https://player.vimeo.com/api/player.js", S = "Vimeo", C = (e) => e.replace("/manage/videos", ""), w = class extends v.Component {
27
+ constructor() {
28
+ super(...arguments), g(this, "callPlayer", y.callPlayer), g(this, "duration", null), g(this, "currentTime", null), g(this, "secondsLoaded", null), g(this, "mute", () => {
29
+ this.setMuted(!0);
30
+ }), g(this, "unmute", () => {
31
+ this.setMuted(!1);
32
+ }), g(this, "ref", (e) => {
33
+ this.container = e;
34
+ });
35
+ }
36
+ componentDidMount() {
37
+ this.props.onMount && this.props.onMount(this);
38
+ }
39
+ load(e) {
40
+ this.duration = null, (0, y.getSDK)(x, S).then((t) => {
41
+ if (!this.container) return;
42
+ let { playerOptions: n, title: r } = this.props.config;
43
+ this.player = new t.Player(this.container, {
44
+ url: C(e),
45
+ autoplay: this.props.playing,
46
+ muted: this.props.muted,
47
+ loop: this.props.loop,
48
+ playsinline: this.props.playsinline,
49
+ controls: this.props.controls,
50
+ ...n
51
+ }), this.player.ready().then(() => {
52
+ let e = this.container.querySelector("iframe");
53
+ e.style.width = "100%", e.style.height = "100%", r && (e.title = r);
54
+ }).catch(this.props.onError), this.player.on("loaded", () => {
55
+ this.props.onReady(), this.refreshDuration();
56
+ }), this.player.on("play", () => {
57
+ this.props.onPlay(), this.refreshDuration();
58
+ }), this.player.on("pause", this.props.onPause), this.player.on("seeked", (e) => this.props.onSeek(e.seconds)), this.player.on("ended", this.props.onEnded), this.player.on("error", this.props.onError), this.player.on("timeupdate", ({ seconds: e }) => {
59
+ this.currentTime = e;
60
+ }), this.player.on("progress", ({ seconds: e }) => {
61
+ this.secondsLoaded = e;
62
+ }), this.player.on("bufferstart", this.props.onBuffer), this.player.on("bufferend", this.props.onBufferEnd), this.player.on("playbackratechange", (e) => this.props.onPlaybackRateChange(e.playbackRate));
63
+ }, this.props.onError);
64
+ }
65
+ refreshDuration() {
66
+ this.player.getDuration().then((e) => {
67
+ this.duration = e;
68
+ });
69
+ }
70
+ play() {
71
+ let e = this.callPlayer("play");
72
+ e && e.catch(this.props.onError);
73
+ }
74
+ pause() {
75
+ this.callPlayer("pause");
76
+ }
77
+ stop() {
78
+ this.callPlayer("unload");
79
+ }
80
+ seekTo(e, t = !0) {
81
+ this.callPlayer("setCurrentTime", e), t || this.pause();
82
+ }
83
+ setVolume(e) {
84
+ this.callPlayer("setVolume", e);
85
+ }
86
+ setMuted(e) {
87
+ this.callPlayer("setMuted", e);
88
+ }
89
+ setLoop(e) {
90
+ this.callPlayer("setLoop", e);
91
+ }
92
+ setPlaybackRate(e) {
93
+ this.callPlayer("setPlaybackRate", e);
94
+ }
95
+ getDuration() {
96
+ return this.duration;
97
+ }
98
+ getCurrentTime() {
99
+ return this.currentTime;
100
+ }
101
+ getSecondsLoaded() {
102
+ return this.secondsLoaded;
103
+ }
104
+ render() {
105
+ let { display: e } = this.props, t = {
106
+ width: "100%",
107
+ height: "100%",
108
+ overflow: "hidden",
109
+ display: e
110
+ };
111
+ return /* @__PURE__ */ v.default.createElement("div", {
112
+ key: this.props.url,
113
+ ref: this.ref,
114
+ style: t
115
+ });
116
+ }
117
+ };
118
+ g(w, "displayName", "Vimeo"), g(w, "canPlay", b.canPlay.vimeo), g(w, "forceLoad", !0);
119
+ }));
120
+ //#endregion
121
+ export default i();
@@ -0,0 +1,108 @@
1
+ import { i as e, t } from "./chunk-jwUa06l-.js";
2
+ import { n, t as r } from "./ai-tutor.js";
3
+ //#region node_modules/react-player/lib/players/Wistia.js
4
+ var i = /* @__PURE__ */ t(((t, i) => {
5
+ var a = Object.create, o = Object.defineProperty, s = Object.getOwnPropertyDescriptor, c = Object.getOwnPropertyNames, l = Object.getPrototypeOf, u = Object.prototype.hasOwnProperty, d = (e, t, n) => t in e ? o(e, t, {
6
+ enumerable: !0,
7
+ configurable: !0,
8
+ writable: !0,
9
+ value: n
10
+ }) : e[t] = n, f = (e, t) => {
11
+ for (var n in t) o(e, n, {
12
+ get: t[n],
13
+ enumerable: !0
14
+ });
15
+ }, p = (e, t, n, r) => {
16
+ if (t && typeof t == "object" || typeof t == "function") for (let i of c(t)) !u.call(e, i) && i !== n && o(e, i, {
17
+ get: () => t[i],
18
+ enumerable: !(r = s(t, i)) || r.enumerable
19
+ });
20
+ return e;
21
+ }, m = (e, t, n) => (n = e == null ? {} : a(l(e)), p(t || !e || !e.__esModule ? o(n, "default", {
22
+ value: e,
23
+ enumerable: !0
24
+ }) : n, e)), h = (e) => p(o({}, "__esModule", { value: !0 }), e), g = (e, t, n) => (d(e, typeof t == "symbol" ? t : t + "", n), n), _ = {};
25
+ f(_, { default: () => w }), i.exports = h(_);
26
+ var v = m(e("react")), y = n(), b = r(), x = "https://fast.wistia.com/assets/external/E-v1.js", S = "Wistia", C = "wistia-player-", w = class extends v.Component {
27
+ constructor() {
28
+ super(...arguments), g(this, "callPlayer", y.callPlayer), g(this, "playerID", this.props.config.playerId || `${C}${(0, y.randomString)()}`), g(this, "onPlay", (...e) => this.props.onPlay(...e)), g(this, "onPause", (...e) => this.props.onPause(...e)), g(this, "onSeek", (...e) => this.props.onSeek(...e)), g(this, "onEnded", (...e) => this.props.onEnded(...e)), g(this, "onPlaybackRateChange", (...e) => this.props.onPlaybackRateChange(...e)), g(this, "mute", () => {
29
+ this.callPlayer("mute");
30
+ }), g(this, "unmute", () => {
31
+ this.callPlayer("unmute");
32
+ });
33
+ }
34
+ componentDidMount() {
35
+ this.props.onMount && this.props.onMount(this);
36
+ }
37
+ load(e) {
38
+ let { playing: t, muted: n, controls: r, onReady: i, config: a, onError: o } = this.props;
39
+ (0, y.getSDK)(x, S).then((e) => {
40
+ a.customControls && a.customControls.forEach((t) => e.defineControl(t)), window._wq = window._wq || [], window._wq.push({
41
+ id: this.playerID,
42
+ options: {
43
+ autoPlay: t,
44
+ silentAutoPlay: "allow",
45
+ muted: n,
46
+ controlsVisibleOnLoad: r,
47
+ fullscreenButton: r,
48
+ playbar: r,
49
+ playbackRateControl: r,
50
+ qualityControl: r,
51
+ volumeControl: r,
52
+ settingsControl: r,
53
+ smallPlayButton: r,
54
+ ...a.options
55
+ },
56
+ onReady: (e) => {
57
+ this.player = e, this.unbind(), this.player.bind("play", this.onPlay), this.player.bind("pause", this.onPause), this.player.bind("seek", this.onSeek), this.player.bind("end", this.onEnded), this.player.bind("playbackratechange", this.onPlaybackRateChange), i();
58
+ }
59
+ });
60
+ }, o);
61
+ }
62
+ unbind() {
63
+ this.player.unbind("play", this.onPlay), this.player.unbind("pause", this.onPause), this.player.unbind("seek", this.onSeek), this.player.unbind("end", this.onEnded), this.player.unbind("playbackratechange", this.onPlaybackRateChange);
64
+ }
65
+ play() {
66
+ this.callPlayer("play");
67
+ }
68
+ pause() {
69
+ this.callPlayer("pause");
70
+ }
71
+ stop() {
72
+ this.unbind(), this.callPlayer("remove");
73
+ }
74
+ seekTo(e, t = !0) {
75
+ this.callPlayer("time", e), t || this.pause();
76
+ }
77
+ setVolume(e) {
78
+ this.callPlayer("volume", e);
79
+ }
80
+ setPlaybackRate(e) {
81
+ this.callPlayer("playbackRate", e);
82
+ }
83
+ getDuration() {
84
+ return this.callPlayer("duration");
85
+ }
86
+ getCurrentTime() {
87
+ return this.callPlayer("time");
88
+ }
89
+ getSecondsLoaded() {
90
+ return null;
91
+ }
92
+ render() {
93
+ let { url: e } = this.props, t = e && e.match(b.MATCH_URL_WISTIA)[1], n = `wistia_embed wistia_async_${t}`;
94
+ return /* @__PURE__ */ v.default.createElement("div", {
95
+ id: this.playerID,
96
+ key: t,
97
+ className: n,
98
+ style: {
99
+ width: "100%",
100
+ height: "100%"
101
+ }
102
+ });
103
+ }
104
+ };
105
+ g(w, "displayName", "Wistia"), g(w, "canPlay", b.canPlay.wistia), g(w, "loopOnEnded", !0);
106
+ }));
107
+ //#endregion
108
+ export default i();
@@ -0,0 +1,155 @@
1
+ import { i as e, t } from "./chunk-jwUa06l-.js";
2
+ import { n, t as r } from "./ai-tutor.js";
3
+ //#region node_modules/react-player/lib/players/YouTube.js
4
+ var i = /* @__PURE__ */ t(((t, i) => {
5
+ var a = Object.create, o = Object.defineProperty, s = Object.getOwnPropertyDescriptor, c = Object.getOwnPropertyNames, l = Object.getPrototypeOf, u = Object.prototype.hasOwnProperty, d = (e, t, n) => t in e ? o(e, t, {
6
+ enumerable: !0,
7
+ configurable: !0,
8
+ writable: !0,
9
+ value: n
10
+ }) : e[t] = n, f = (e, t) => {
11
+ for (var n in t) o(e, n, {
12
+ get: t[n],
13
+ enumerable: !0
14
+ });
15
+ }, p = (e, t, n, r) => {
16
+ if (t && typeof t == "object" || typeof t == "function") for (let i of c(t)) !u.call(e, i) && i !== n && o(e, i, {
17
+ get: () => t[i],
18
+ enumerable: !(r = s(t, i)) || r.enumerable
19
+ });
20
+ return e;
21
+ }, m = (e, t, n) => (n = e == null ? {} : a(l(e)), p(t || !e || !e.__esModule ? o(n, "default", {
22
+ value: e,
23
+ enumerable: !0
24
+ }) : n, e)), h = (e) => p(o({}, "__esModule", { value: !0 }), e), g = (e, t, n) => (d(e, typeof t == "symbol" ? t : t + "", n), n), _ = {};
25
+ f(_, { default: () => O }), i.exports = h(_);
26
+ var v = m(e("react")), y = n(), b = r(), x = "https://www.youtube.com/iframe_api", S = "YT", C = "onYouTubeIframeAPIReady", w = /[?&](?:list|channel)=([a-zA-Z0-9_-]+)/, T = /user\/([a-zA-Z0-9_-]+)\/?/, E = /youtube-nocookie\.com/, D = "https://www.youtube-nocookie.com", O = class extends v.Component {
27
+ constructor() {
28
+ super(...arguments), g(this, "callPlayer", y.callPlayer), g(this, "parsePlaylist", (e) => {
29
+ if (e instanceof Array) return {
30
+ listType: "playlist",
31
+ playlist: e.map(this.getID).join(",")
32
+ };
33
+ if (w.test(e)) {
34
+ let [, t] = e.match(w);
35
+ return {
36
+ listType: "playlist",
37
+ list: t.replace(/^UC/, "UU")
38
+ };
39
+ }
40
+ if (T.test(e)) {
41
+ let [, t] = e.match(T);
42
+ return {
43
+ listType: "user_uploads",
44
+ list: t
45
+ };
46
+ }
47
+ return {};
48
+ }), g(this, "onStateChange", (e) => {
49
+ let { data: t } = e, { onPlay: n, onPause: r, onBuffer: i, onBufferEnd: a, onEnded: o, onReady: s, loop: c, config: { playerVars: l, onUnstarted: u } } = this.props, { UNSTARTED: d, PLAYING: f, PAUSED: p, BUFFERING: m, ENDED: h, CUED: g } = window[S].PlayerState;
50
+ if (t === d && u(), t === f && (n(), a()), t === p && r(), t === m && i(), t === h) {
51
+ let e = !!this.callPlayer("getPlaylist");
52
+ c && !e && (l.start ? this.seekTo(l.start) : this.play()), o();
53
+ }
54
+ t === g && s();
55
+ }), g(this, "mute", () => {
56
+ this.callPlayer("mute");
57
+ }), g(this, "unmute", () => {
58
+ this.callPlayer("unMute");
59
+ }), g(this, "ref", (e) => {
60
+ this.container = e;
61
+ });
62
+ }
63
+ componentDidMount() {
64
+ this.props.onMount && this.props.onMount(this);
65
+ }
66
+ getID(e) {
67
+ return !e || e instanceof Array || w.test(e) ? null : e.match(b.MATCH_URL_YOUTUBE)[1];
68
+ }
69
+ load(e, t) {
70
+ let { playing: n, muted: r, playsinline: i, controls: a, loop: o, config: s, onError: c } = this.props, { playerVars: l, embedOptions: u } = s, d = this.getID(e);
71
+ if (t) {
72
+ if (w.test(e) || T.test(e) || e instanceof Array) {
73
+ this.player.loadPlaylist(this.parsePlaylist(e));
74
+ return;
75
+ }
76
+ this.player.cueVideoById({
77
+ videoId: d,
78
+ startSeconds: (0, y.parseStartTime)(e) || l.start,
79
+ endSeconds: (0, y.parseEndTime)(e) || l.end
80
+ });
81
+ return;
82
+ }
83
+ (0, y.getSDK)(x, S, C, (e) => e.loaded).then((t) => {
84
+ this.container && (this.player = new t.Player(this.container, {
85
+ width: "100%",
86
+ height: "100%",
87
+ videoId: d,
88
+ playerVars: {
89
+ autoplay: +!!n,
90
+ mute: +!!r,
91
+ controls: +!!a,
92
+ start: (0, y.parseStartTime)(e),
93
+ end: (0, y.parseEndTime)(e),
94
+ origin: window.location.origin,
95
+ playsinline: +!!i,
96
+ ...this.parsePlaylist(e),
97
+ ...l
98
+ },
99
+ events: {
100
+ onReady: () => {
101
+ o && this.player.setLoop(!0), this.props.onReady();
102
+ },
103
+ onPlaybackRateChange: (e) => this.props.onPlaybackRateChange(e.data),
104
+ onPlaybackQualityChange: (e) => this.props.onPlaybackQualityChange(e),
105
+ onStateChange: this.onStateChange,
106
+ onError: (e) => c(e.data)
107
+ },
108
+ host: E.test(e) ? D : void 0,
109
+ ...u
110
+ }));
111
+ }, c), u.events && console.warn("Using `embedOptions.events` will likely break things. Use ReactPlayer’s callback props instead, eg onReady, onPlay, onPause");
112
+ }
113
+ play() {
114
+ this.callPlayer("playVideo");
115
+ }
116
+ pause() {
117
+ this.callPlayer("pauseVideo");
118
+ }
119
+ stop() {
120
+ document.body.contains(this.callPlayer("getIframe")) && this.callPlayer("stopVideo");
121
+ }
122
+ seekTo(e, t = !1) {
123
+ this.callPlayer("seekTo", e), !t && !this.props.playing && this.pause();
124
+ }
125
+ setVolume(e) {
126
+ this.callPlayer("setVolume", e * 100);
127
+ }
128
+ setPlaybackRate(e) {
129
+ this.callPlayer("setPlaybackRate", e);
130
+ }
131
+ setLoop(e) {
132
+ this.callPlayer("setLoop", e);
133
+ }
134
+ getDuration() {
135
+ return this.callPlayer("getDuration");
136
+ }
137
+ getCurrentTime() {
138
+ return this.callPlayer("getCurrentTime");
139
+ }
140
+ getSecondsLoaded() {
141
+ return this.callPlayer("getVideoLoadedFraction") * this.getDuration();
142
+ }
143
+ render() {
144
+ let { display: e } = this.props, t = {
145
+ width: "100%",
146
+ height: "100%",
147
+ display: e
148
+ };
149
+ return /* @__PURE__ */ v.default.createElement("div", { style: t }, /* @__PURE__ */ v.default.createElement("div", { ref: this.ref }));
150
+ }
151
+ };
152
+ g(O, "displayName", "YouTube"), g(O, "canPlay", b.canPlay.youtube);
153
+ }));
154
+ //#endregion
155
+ export default i();