Skip to content

Commit 300037e

Browse files
authored
Merge pull request #72 from immense/onboarding-video-series
Onboarding video series
2 parents a44fd96 + 0ce31c9 commit 300037e

File tree

7 files changed

+4732
-4503
lines changed

7 files changed

+4732
-4503
lines changed
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
<script setup>
2+
import { computed, onMounted } from 'vue'
3+
4+
const props = defineProps({
5+
mediaId: {
6+
type: String,
7+
default: '',
8+
},
9+
channelId: {
10+
type: String,
11+
default: '',
12+
},
13+
aspect: {
14+
type: [String, Number],
15+
default: 16 / 9,
16+
},
17+
swatch: {
18+
type: String,
19+
default: '',
20+
},
21+
})
22+
23+
const mediaIdValue = computed(() => props.mediaId.trim())
24+
const channelIdValue = computed(() => props.channelId.trim())
25+
const hasMedia = computed(() => mediaIdValue.value.length > 0)
26+
const hasChannel = computed(() => channelIdValue.value.length > 0)
27+
28+
const embedType = computed(() => {
29+
if (hasChannel.value) return 'playlist'
30+
if (hasMedia.value) return 'media'
31+
return 'none'
32+
})
33+
34+
const aspectValue = computed(() => {
35+
const value = Number(props.aspect)
36+
return Number.isFinite(value) && value > 0 ? value : 16 / 9
37+
})
38+
39+
const paddingTop = computed(() => `${(1 / aspectValue.value) * 100}%`)
40+
const swatchUrl = computed(() => {
41+
if (!hasMedia.value) return ''
42+
return (
43+
props.swatch ||
44+
`https://fast.wistia.com/embed/medias/${mediaIdValue.value}/swatch`
45+
)
46+
})
47+
const embedSrc = computed(() => {
48+
if (!hasMedia.value) return ''
49+
return `https://fast.wistia.com/embed/${mediaIdValue.value}.js`
50+
})
51+
52+
const ensureScript = (src, options = {}) => {
53+
if (document.querySelector(`script[data-wistia-src="${src}"]`)) return
54+
55+
const script = document.createElement('script')
56+
script.src = src
57+
script.async = true
58+
if (options.type) script.type = options.type
59+
script.setAttribute('data-wistia-src', src)
60+
document.head.appendChild(script)
61+
}
62+
63+
const ensureStyle = () => {
64+
const styleId = `wistia-style-${mediaIdValue.value}`
65+
if (document.getElementById(styleId)) return
66+
67+
const style = document.createElement('style')
68+
style.id = styleId
69+
style.textContent = `wistia-player[media-id="${mediaIdValue.value}"]:not(:defined) { background: center / contain no-repeat url('${swatchUrl.value}'); display: block; filter: blur(5px); padding-top: ${paddingTop.value}; }`
70+
document.head.appendChild(style)
71+
}
72+
73+
onMounted(() => {
74+
if (!hasMedia.value && !hasChannel.value) {
75+
console.warn('WistiaEmbed requires either media-id or channel-id.')
76+
return
77+
}
78+
79+
if (hasMedia.value && hasChannel.value) {
80+
console.warn(
81+
'WistiaEmbed received both media-id and channel-id; using channel-id.'
82+
)
83+
}
84+
85+
if (embedType.value === 'playlist') {
86+
ensureScript('https://fast.wistia.com/playlist.js')
87+
return
88+
}
89+
90+
ensureScript('https://fast.wistia.com/player.js')
91+
ensureScript(embedSrc.value, { type: 'module' })
92+
ensureStyle()
93+
})
94+
</script>
95+
96+
<template>
97+
<wistia-playlist
98+
v-if="embedType === 'playlist'"
99+
:channel-id="channelIdValue"
100+
></wistia-playlist>
101+
<wistia-player
102+
v-else-if="embedType === 'media'"
103+
:media-id="mediaIdValue"
104+
:aspect="aspectValue"
105+
></wistia-player>
106+
</template>

.vitepress/config.mts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,14 @@ j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
2020
]
2121
],
2222
description: "A documentation suite for all things ImmyBot",
23+
vue: {
24+
template: {
25+
compilerOptions: {
26+
isCustomElement: (tag) =>
27+
tag === 'wistia-player' || tag === 'wistia-playlist',
28+
},
29+
},
30+
},
2331
sitemap: {
2432
hostname: 'https://docs.immy.bot'
2533
},
@@ -239,4 +247,4 @@ j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
239247
ignoreDeadLinks: true
240248

241249

242-
});
250+
});

.vitepress/theme/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// https://vitepress.dev/guide/custom-theme
22
import { h } from 'vue';
33
import Theme from 'vitepress/theme';
4+
import WistiaEmbed from '../components/WistiaEmbed.vue';
45
import './style.css';
56
import './immy.css';
67

@@ -12,6 +13,6 @@ export default {
1213
});
1314
},
1415
enhanceApp({ app, router, siteData }) {
15-
// ...
16+
app.component('WistiaEmbed', WistiaEmbed);
1617
}
17-
};
18+
};

Documentation/GettingStarted/quick-start-guide.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
This guide will help you get up and running with ImmyBot in under 30 minutes. Follow these steps to set up your account, connect your first computer, and create your first deployment.
44

5+
<WistiaEmbed channel-id="wq8r00965n" />
6+
57
## Understanding the ImmyBot Approach
68

79
**The goal of ImmyBot is to set up a computer knowing only the customer and the end user.**
@@ -15,6 +17,9 @@ Before you begin, make sure you have:
1517
- Administrator access to a test computer (physical or virtual)
1618
- A USB drive (for physical computers)
1719

20+
<WistiaEmbed media-id="exwm9mtop7" />
21+
Getting Started With ImmyBot
22+
1823
## Step 1: Log in to ImmyBot
1924

2025
1. Navigate to your ImmyBot instance URL (typically `https://yourdomain.immy.bot`)
@@ -27,6 +32,12 @@ You'll be greeted with the ImmyBot dashboard, which provides an overview of your
2732

2833
When you first log in to ImmyBot, the Getting Started Wizard will prompt you to create an ImmyBot flash drive.
2934

35+
<WistiaEmbed media-id="pzcxwj7coz" />
36+
37+
:::details Click here for virtual machines
38+
<WistiaEmbed media-id="o0ax7wfnph" />
39+
:::
40+
3041
::: info
3142
**Important:** You only need to create this USB drive ONCE. The same drive can be used for all clients and computers. You'll select the specific client after the computer connects to ImmyBot.
3243
:::
@@ -54,6 +65,8 @@ We recommend leaving this default, then in one of your first deployments, deleti
5465

5566
## Step 3: Connect the Computer
5667

68+
<WistiaEmbed media-id="gf9iwrtj3o" />
69+
5770
### For Physical Computers (Recommended)
5871

5972
We recommend using a physical computer (Dell, HP, or Lenovo) for your first setup to experience the full capabilities of ImmyBot, including BIOS and driver updates.
@@ -80,6 +93,8 @@ Once the provisioning package is applied, the computer will connect to ImmyBot a
8093

8194
## Step 5: Assign Customer and User
8295

96+
<WistiaEmbed media-id="phre3e9stm" />
97+
8398
For ImmyBot to properly configure the computer, you need to specify:
8499

85100
1. **Customer (Required)**: The organization that owns the computer
@@ -94,6 +109,8 @@ For ImmyBot to properly configure the computer, you need to specify:
94109
95110
## Step 6: Create Your First Deployment
96111

112+
<WistiaEmbed media-id="zrgvbigvzo" />
113+
97114
Now let's create a simple deployment to install a software package:
98115

99116
1. Navigate to **Deployments** in the left sidebar
@@ -136,6 +153,8 @@ These conditions are defined using filter scripts, or metascripts that can check
136153

137154
## Step 7: Run a Maintenance Session
138155

156+
<WistiaEmbed media-id="q3f1fib97g" />
157+
139158
To apply your new deployment immediately:
140159

141160
1. Navigate to **Computers** in the left sidebar
@@ -168,4 +187,3 @@ Congratulations! You've successfully set up ImmyBot, connected your first comput
168187
- [Core Concepts](/Documentation/GettingStarted/core-concepts.md) - Understand the fundamental concepts of ImmyBot
169188
- [Creating Deployments](/Documentation/HowToGuides/creating-managing-deployments.md) - Explore advanced deployment options
170189
- [Integration Overview](/Documentation/Integrations//integration-overview.md) - Connect ImmyBot to your existing tools
171-

README.md

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,31 @@ There will be a link to the localhost URL in your terminal, by default it is: ht
3232

3333
Save pages as you edit them, they will be automatically updated in your browser. Any changes made to /.vitepress/config.mts will cause the instance to restart locally.
3434

35+
## Wistia Embeds
36+
37+
Use the `WistiaEmbed` component to add Wistia videos or channel playlists in Markdown without page-level scripts.
38+
39+
Example (single video):
40+
41+
```
42+
<WistiaEmbed media-id="j4jjmljlxw" />
43+
```
44+
45+
Example (channel playlist):
46+
47+
```
48+
<WistiaEmbed channel-id="wq8r00965n" />
49+
```
50+
51+
Required props:
52+
- `media-id` for single videos or `channel-id` for channel playlists
53+
54+
Optional props (video only):
55+
- `aspect` (number or string, default `16/9`)
56+
- `swatch` (string URL override for the preview image)
57+
58+
You can place multiple embeds on the same page by repeating the component with different `media-id` or `channel-id` values.
59+
3560
## Project Structure
3661

3762
```
@@ -76,5 +101,3 @@ You can reference the information by using
76101
9. Test your changes
77102
10. Commit and push your changes to the PR
78103
11. If everything is satisfactory the changes will be merged into the main branch
79-
80-

0 commit comments

Comments
 (0)