Skip to content

Commit 18ab9c5

Browse files
committed
Update README.md
1 parent ea8562a commit 18ab9c5

1 file changed

Lines changed: 58 additions & 77 deletions

File tree

README.md

Lines changed: 58 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -1,142 +1,124 @@
11
# Weather Videos (Mawaqit 360)
22

3-
This repository hosts **weather background scene videos** used in the **Mawaqit 360 view**.
3+
This repository hosts **weather background scene videos** used in the **Mawaqit 360 view**.
44
The mobile app downloads and updates these videos dynamically based on a remote `manifest.json`.
55

66
The goal is to allow lightweight updates to weather animations **without shipping a new app release**.
77

88
---
99

10-
## 📁 Structure
10+
## 📁 Directory Structure
1111

1212
```
1313
weather-videos/
14-
├── cloudy.mp4
15-
├── rain.mp4
16-
├── snow.mp4
17-
└── manifest.json
14+
├── cloudy.mp4
15+
├── overcast.mp4
16+
├── light_rain.mp4
17+
├── rain.mp4
18+
├── snow.mp4
19+
├── thunderstorm.mp4
20+
├── sunny.mp4
21+
└── manifest.json
1822
```
1923

20-
* All weather scene videos live inside `weather-videos/`
21-
* `manifest.json` controls versioning, size, and download URLs
24+
- All weather scene videos live inside `weather-videos/`
25+
- `manifest.json` controls versioning and download URLs
2226

2327
---
2428

25-
## 📄 manifest.json format
29+
## 📄 manifest.json Format
2630

2731
```json
2832
{
2933
"videos": {
3034
"cloudy": {
3135
"url": "https://raw.githubusercontent.com/mawaqit/mobile-assets/main/weather-videos/cloudy.mp4",
32-
"version": "1.0.0",
33-
"size": 456931
36+
"version": "1.0.0"
37+
},
38+
"overcast": {
39+
"url": "https://raw.githubusercontent.com/mawaqit/mobile-assets/main/weather-videos/overcast.mp4",
40+
"version": "1.0.0"
41+
},
42+
"light_rain": {
43+
"url": "https://raw.githubusercontent.com/mawaqit/mobile-assets/main/weather-videos/light_rain.mp4",
44+
"version": "1.0.0"
45+
},
46+
"rain": {
47+
"url": "https://raw.githubusercontent.com/mawaqit/mobile-assets/main/weather-videos/rain.mp4",
48+
"version": "1.0.0"
49+
},
50+
"snow": {
51+
"url": "https://raw.githubusercontent.com/mawaqit/mobile-assets/main/weather-videos/snow.mp4",
52+
"version": "1.0.0"
53+
},
54+
"thunderstorm": {
55+
"url": "https://raw.githubusercontent.com/mawaqit/mobile-assets/main/weather-videos/thunderstorm.mp4",
56+
"version": "1.0.0"
3457
}
3558
}
3659
}
3760
```
3861

39-
### Fields
40-
41-
| Field | Description |
42-
| --------- | ---------------------------------- |
43-
| `url` | Direct GitHub raw URL to the video |
44-
| `version` | Manual version number |
45-
| `size` | File size in **bytes** |
46-
47-
**Important:**
48-
Size must be in bytes (not KB/MB).
62+
⚠️ **Important**: JSON keys must match your weather scene constants exactly (`cloudy`, `overcast`, `light_rain`, `rain`, `snow`, `thunderstorm`) for the app to recognize them.
4963

5064
---
5165

52-
## ⚙️ How the app updates videos
66+
## ⚙️ How the App Updates Videos
5367

54-
On app launch (when internet is available):
68+
On app launch (with internet access):
5569

5670
1. App downloads remote `manifest.json`
5771
2. Compares with local manifest
5872
3. If a video's `version` differs → only that video is downloaded
5973
4. Local cache updates automatically
6074
5. New animation appears in Mawaqit 360
6175

62-
Only changed videos are fetched.
76+
**Only changed videos are fetched.**
6377

6478
---
6579

66-
## 🚀 How to update a weather video
80+
## 🚀 How to Update a Weather Video
6781

68-
### 1. Upload or replace video
82+
### 1. Upload or Replace Video
6983

7084
Add or replace the `.mp4` file inside:
7185

7286
```
7387
weather-videos/
7488
```
7589

76-
File names can change.
77-
Only the `url` and `version` in `manifest.json` matter.
78-
79-
---
80-
81-
### 2. Get file size (bytes)
90+
File names can change. Only the `url` and `version` in `manifest.json` matter.
8291

83-
macOS:
92+
### 2. Update `manifest.json`
8493

85-
```bash
86-
stat -f%z rain.mp4
87-
```
88-
89-
Linux:
90-
91-
```bash
92-
stat -c%s rain.mp4
93-
```
94-
95-
---
96-
97-
### 3. Update `manifest.json`
98-
99-
* Update `url` if filename changed
100-
* **Increment version manually**
101-
* Update `size` in bytes
94+
- Update `url` if filename changed
95+
- Increment version manually
10296

10397
Example:
10498

10599
```json
106100
"rain": {
107101
"url": "https://raw.githubusercontent.com/mawaqit/mobile-assets/main/weather-videos/rain.mp4",
108-
"version": "1.0.1",
109-
"size": 2536636
102+
"version": "1.0.1"
110103
}
111104
```
112105

113-
---
114-
115-
### 4. Commit & push
106+
### 3. Commit & Push
116107

117-
Once pushed to `main`, users will receive updates automatically
118-
on next app launch (if internet is available).
108+
Once pushed to `main`, users will receive updates automatically on next app launch (if internet is available).
119109

120110
---
121111

122-
## 🧪 Helpful commands
123-
124-
Print filename + size in bytes (macOS):
125-
126-
```bash
127-
stat -f "%N %z" *.mp4
128-
```
112+
## 🧪 Helpful Commands
129113

130114
Generate manifest entries quickly:
131115

132116
```bash
133117
for f in *.mp4; do
134118
name="${f%.*}"
135-
size=$(stat -f%z "$f")
136119
echo "\"$name\": {"
137120
echo " \"url\": \"https://raw.githubusercontent.com/mawaqit/mobile-assets/main/weather-videos/$f\","
138-
echo " \"version\": \"1.0.0\","
139-
echo " \"size\": $size"
121+
echo " \"version\": \"1.0.0\""
140122
echo "},"
141123
done
142124
```
@@ -145,11 +127,11 @@ done
145127

146128
## ⚠️ Guidelines
147129

148-
* Always increment version when a video changes
149-
* Do not change version unnecessarily
150-
* Ensure size is correct
151-
* Verify raw GitHub URL works
152-
* Keep videos optimized for mobile
130+
- Always increment version when a video changes
131+
- Do not change version unnecessarily
132+
- Verify raw GitHub URL works
133+
- Keep JSON keys aligned with the weather scene constants
134+
- Keep videos optimized for mobile
153135

154136
---
155137

@@ -159,9 +141,8 @@ Both internal and external contributors can update weather scenes.
159141

160142
Before merging:
161143

162-
* Verify video plays correctly
163-
* Confirm size in bytes
164-
* Confirm version bump
165-
* Validate JSON formatting
144+
- Verify video plays correctly
145+
- Confirm version bump
146+
- Validate JSON formatting
166147

167-
If unsure, open a PR and ask for review.
148+
If unsure, open a PR and ask for review.

0 commit comments

Comments
 (0)