-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathMedia.ts
203 lines (188 loc) · 5.1 KB
/
Media.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
import { t } from 'ttag';
import SimpleSchema from 'simpl-schema';
import './SimpleSchemaExtensions';
import { Length, LengthSchema, quantityDefinition } from './Units';
import {
IetfLanguageTag,
ietfLanguageTags,
ietfLanguageTagsAndSignLanguageCodes,
IetfLanguageTagOrSignLanguageCode
} from './ietfLanguageTags';
import { LocalizedStringSchema, LocalizedString } from './LocalizedString';
/**
* Describes a media unit provided at this place, for example an exhibit at a museum or a movie in
* a cinema.
*/
export interface Media {
/**
* Type of the media unit
*/
type: 'document' | 'menu' | 'guide' | 'presentation' | 'exhibit' | 'movie' | 'play' | 'screen' | 'in-room-compendium';
/**
* Name of the media unit (relevant if there are multiple units of the same kind)
*/
name?: LocalizedString;
/**
* Is the media unit consumable or described for Braille readers?
*/
isBraille?: boolean;
/**
* Is the media unit consumable as audio-only option?
*/
isAudio?: boolean;
/**
* If the media unit is printed, is the print large?
*/
isLargePrint?: boolean;
/**
* If the media unit is printed or on a screen, does it have high contrast between background and
* foreground?
*/
hasContrastingBackground?: boolean;
/**
* Relevant for movies, screens and presentations: Is there a dedicated screen where subtitles can
* be read?
*/
hasDedicatedScreenForSubtitles?: boolean;
/**
* Is the media unit provided with subtitles?
*/
hasSubtitles?: boolean;
/**
* Does the media unit have [real time captioning](https://www.washington.edu/doit/what-real-time-captioning)?
*/
hasRealTimeCaptioning?: boolean;
/**
* Is the media unit provided in a [Plain Language](https://en.wikipedia.org/wiki/Plain_language) option?
*/
hasPlainLanguageOption?: boolean;
/**
* Specifies which languages (including sign languages) in which the media unit is provided
*/
languages?: ArrayLike<IetfLanguageTagOrSignLanguageCode>;
/**
* If the media is consumed while the consumer is directly in front of it, this property specifies
* how much turning space there is in front of it.
*/
turningSpaceInFront?: Length;
}
export const MediaSchema = new SimpleSchema({
type: {
type: String,
label: t`Media Type`,
allowedValues: [
'document',
'menu',
'guide',
'presentation',
'exhibit',
'movie',
'play',
'screen',
'in-room-compendium'
],
accessibility: {
question: t`What kind of media is described?`,
options: [
{ value: 'document', label: t`document` },
{ value: 'menu', label: t`menu` },
{ value: 'guide', label: t`guide` },
{ value: 'presentation', label: t`presentation` },
{ value: 'exhibit', label: t`exhibit` },
{ value: 'movie', label: t`movie` },
{ value: 'screen', label: t`screen` },
{ value: 'in-room-compendium', label: t`in-room-compendium` }
]
}
},
name: {
type: LocalizedStringSchema,
label: t`Media Name`,
optional: true,
accessibility: {
question: t`What the name of the`,
description: t`e.g. 'daily menu' or 'park guide'`
}
},
isBraille: {
type: Boolean,
label: t`Braille`,
optional: true,
accessibility: {
question: t`Is there a braille version available?`
}
},
isAudio: {
type: Boolean,
label: t`Audio`,
optional: true,
accessibility: {
question: t`Is there an audio version available?`
}
},
isLargePrint: {
type: Boolean,
label: t`Large Print`,
optional: true,
accessibility: {
question: t`Is there a large print version available?`
}
},
hasContrastingBackground: {
type: Boolean,
label: t`Contrasting Background`,
optional: true,
accessibility: {
question: t`Is the print on a contrasting background?`
}
},
hasDedicatedScreenForSubtitles: {
type: Boolean,
label: t`Dedicated Subtitle Screen`,
optional: true,
accessibility: {
question: t`Is there a dedicated screen for subtitles.`
}
},
hasSubtitles: {
type: Boolean,
label: t`Subtitles`,
optional: true,
accessibility: {
question: t`Are there subtitles?`
}
},
hasRealTimeCaptioning: {
type: Boolean,
label: t`Real-time Captioning`,
optional: true,
accessibility: {
question: t`Is there real time captioning?`
}
},
// There are no standardized language codes for this yet, so this needs to be an extra flag for now.
hasPlainLanguageOption: {
type: Boolean,
label: t`Plain Language Option`,
optional: true,
accessibility: {
question: t`Is there a plain language option?`
}
},
languages: {
type: Array,
label: t`Languages`,
optional: true,
accessibility: {
question: t`What are the available languages?`
}
},
'languages.$': {
type: String,
label: t`Language`,
allowedValues: ietfLanguageTagsAndSignLanguageCodes
},
turningSpaceInFront: quantityDefinition(LengthSchema, true, {
question: t`How much space for turning is in front of the media?`
})
});