feat: add support for addressable videos
This commit is contained in:
@@ -20,7 +20,15 @@ const KIND_FILTER_OPTIONS = [
|
|||||||
{ kindGroup: [ExtendedKind.POLL], label: 'Polls' },
|
{ kindGroup: [ExtendedKind.POLL], label: 'Polls' },
|
||||||
{ kindGroup: [ExtendedKind.VOICE, ExtendedKind.VOICE_COMMENT], label: 'Voice Posts' },
|
{ kindGroup: [ExtendedKind.VOICE, ExtendedKind.VOICE_COMMENT], label: 'Voice Posts' },
|
||||||
{ kindGroup: [ExtendedKind.PICTURE], label: 'Photo Posts' },
|
{ kindGroup: [ExtendedKind.PICTURE], label: 'Photo Posts' },
|
||||||
{ kindGroup: [ExtendedKind.VIDEO, ExtendedKind.SHORT_VIDEO], label: 'Video Posts' }
|
{
|
||||||
|
kindGroup: [
|
||||||
|
ExtendedKind.VIDEO,
|
||||||
|
ExtendedKind.SHORT_VIDEO,
|
||||||
|
ExtendedKind.ADDRESSABLE_NORMAL_VIDEO,
|
||||||
|
ExtendedKind.ADDRESSABLE_SHORT_VIDEO
|
||||||
|
],
|
||||||
|
label: 'Video Posts'
|
||||||
|
}
|
||||||
]
|
]
|
||||||
const ALL_KINDS = KIND_FILTER_OPTIONS.flatMap(({ kindGroup }) => kindGroup)
|
const ALL_KINDS = KIND_FILTER_OPTIONS.flatMap(({ kindGroup }) => kindGroup)
|
||||||
|
|
||||||
|
|||||||
@@ -97,7 +97,12 @@ export default function Note({
|
|||||||
content = <AudioPlayer className="mt-2" src={event.content} />
|
content = <AudioPlayer className="mt-2" src={event.content} />
|
||||||
} else if (event.kind === ExtendedKind.PICTURE) {
|
} else if (event.kind === ExtendedKind.PICTURE) {
|
||||||
content = <PictureNote className="mt-2" event={event} />
|
content = <PictureNote className="mt-2" event={event} />
|
||||||
} else if (event.kind === ExtendedKind.VIDEO || event.kind === ExtendedKind.SHORT_VIDEO) {
|
} else if (
|
||||||
|
event.kind === ExtendedKind.VIDEO ||
|
||||||
|
event.kind === ExtendedKind.SHORT_VIDEO ||
|
||||||
|
event.kind === ExtendedKind.ADDRESSABLE_NORMAL_VIDEO ||
|
||||||
|
event.kind === ExtendedKind.ADDRESSABLE_SHORT_VIDEO
|
||||||
|
) {
|
||||||
content = <VideoNote className="mt-2" event={event} />
|
content = <VideoNote className="mt-2" event={event} />
|
||||||
} else if (event.kind === ExtendedKind.RELAY_REVIEW) {
|
} else if (event.kind === ExtendedKind.RELAY_REVIEW) {
|
||||||
content = <RelayReview className="mt-2" event={event} />
|
content = <RelayReview className="mt-2" event={event} />
|
||||||
|
|||||||
@@ -80,7 +80,9 @@ export const ExtendedKind = {
|
|||||||
FAVORITE_RELAYS: 10012,
|
FAVORITE_RELAYS: 10012,
|
||||||
BLOSSOM_SERVER_LIST: 10063,
|
BLOSSOM_SERVER_LIST: 10063,
|
||||||
RELAY_REVIEW: 31987,
|
RELAY_REVIEW: 31987,
|
||||||
GROUP_METADATA: 39000
|
GROUP_METADATA: 39000,
|
||||||
|
ADDRESSABLE_NORMAL_VIDEO: 34235,
|
||||||
|
ADDRESSABLE_SHORT_VIDEO: 24236
|
||||||
}
|
}
|
||||||
|
|
||||||
export const SUPPORTED_KINDS = [
|
export const SUPPORTED_KINDS = [
|
||||||
@@ -96,7 +98,9 @@ export const SUPPORTED_KINDS = [
|
|||||||
kinds.Highlights,
|
kinds.Highlights,
|
||||||
kinds.LongFormArticle,
|
kinds.LongFormArticle,
|
||||||
ExtendedKind.RELAY_REVIEW,
|
ExtendedKind.RELAY_REVIEW,
|
||||||
kinds.Emojisets
|
kinds.Emojisets,
|
||||||
|
ExtendedKind.ADDRESSABLE_NORMAL_VIDEO,
|
||||||
|
ExtendedKind.ADDRESSABLE_SHORT_VIDEO
|
||||||
]
|
]
|
||||||
|
|
||||||
export const URL_REGEX =
|
export const URL_REGEX =
|
||||||
|
|||||||
@@ -168,14 +168,19 @@ class LocalStorageService {
|
|||||||
} else {
|
} else {
|
||||||
const showKindsVersionStr = window.localStorage.getItem(StorageKey.SHOW_KINDS_VERSION)
|
const showKindsVersionStr = window.localStorage.getItem(StorageKey.SHOW_KINDS_VERSION)
|
||||||
const showKindsVersion = showKindsVersionStr ? parseInt(showKindsVersionStr) : 0
|
const showKindsVersion = showKindsVersionStr ? parseInt(showKindsVersionStr) : 0
|
||||||
const showKinds = JSON.parse(showKindsStr) as number[]
|
const showKindSet = new Set(JSON.parse(showKindsStr) as number[])
|
||||||
if (showKindsVersion < 1) {
|
if (showKindsVersion < 1) {
|
||||||
showKinds.push(ExtendedKind.VIDEO, ExtendedKind.SHORT_VIDEO)
|
showKindSet.add(ExtendedKind.VIDEO)
|
||||||
|
showKindSet.add(ExtendedKind.SHORT_VIDEO)
|
||||||
}
|
}
|
||||||
this.showKinds = showKinds
|
if (showKindsVersion < 2 && showKindSet.has(ExtendedKind.VIDEO)) {
|
||||||
|
showKindSet.add(ExtendedKind.ADDRESSABLE_NORMAL_VIDEO)
|
||||||
|
showKindSet.add(ExtendedKind.ADDRESSABLE_SHORT_VIDEO)
|
||||||
|
}
|
||||||
|
this.showKinds = Array.from(showKindSet)
|
||||||
}
|
}
|
||||||
window.localStorage.setItem(StorageKey.SHOW_KINDS, JSON.stringify(this.showKinds))
|
window.localStorage.setItem(StorageKey.SHOW_KINDS, JSON.stringify(this.showKinds))
|
||||||
window.localStorage.setItem(StorageKey.SHOW_KINDS_VERSION, '1')
|
window.localStorage.setItem(StorageKey.SHOW_KINDS_VERSION, '2')
|
||||||
|
|
||||||
this.hideContentMentioningMutedUsers =
|
this.hideContentMentioningMutedUsers =
|
||||||
window.localStorage.getItem(StorageKey.HIDE_CONTENT_MENTIONING_MUTED_USERS) === 'true'
|
window.localStorage.getItem(StorageKey.HIDE_CONTENT_MENTIONING_MUTED_USERS) === 'true'
|
||||||
|
|||||||
Reference in New Issue
Block a user