Skip to content

Commit

Permalink
Release v4.14.1
Browse files Browse the repository at this point in the history
  • Loading branch information
attemka committed Nov 27, 2023
2 parents 1329901 + 982fc5b commit 819457e
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 11 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [4.14.1] - 2023-11-27

### Fixed

- Fixed asset encoding check error

## [4.14.0] - 2023-11-27

### Added
Expand All @@ -13,7 +19,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed

- Fixed asset encoding check error
- Optimised the queries performance
- Fixed the missing event for funds withdrawal

Expand Down
2 changes: 1 addition & 1 deletion packages/atlas/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@joystream/atlas",
"description": "UI for consuming Joystream - a user governed video platform",
"version": "4.14.0",
"version": "4.14.1",
"license": "GPL-3.0",
"scripts": {
"start": "vite",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export const EndingOverlay: FC<EndingOverlayProps> = ({
navigate(absoluteRoutes.viewer.video(randomNextVideo.id))
}}
>
<VideoThumbnail resolvedUrls={thumbnailUrls} type="video" />
<VideoThumbnail resolvedUrls={thumbnailUrls} type="thumbnail" />
<VideoInfo>
<Text as="span" variant={mdMatch ? 't300' : 't200'} color="colorText">
Up next
Expand Down
5 changes: 3 additions & 2 deletions packages/atlas/src/hooks/useGetAssetUrl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { atlasConfig } from '@/config'
import { logDistributorPerformance, testAssetDownload } from '@/providers/assets/assets.helpers'
import { useOperatorsContext } from '@/providers/assets/assets.provider'
import { AssetType } from '@/providers/uploads/uploads.types'
import { isMobile } from '@/utils/browser'
import { getVideoCodec } from '@/utils/getVideoCodec'
import { ConsoleLogger, DistributorEventEntry, SentryLogger, UserEventsLogger } from '@/utils/logs'
import { withTimeout } from '@/utils/misc'
Expand All @@ -17,14 +18,14 @@ export const getSingleAssetUrl = async (
if (!urls || !urls.length) {
return
}
const mobile = isMobile()

for (const distributionAssetUrl of urls) {
const eventEntry: DistributorEventEntry = {
dataObjectId: id,
dataObjectType: type || undefined,
resolvedUrl: distributionAssetUrl,
}

const assetTestPromise = testAssetDownload(distributionAssetUrl, type)
const assetTestPromiseWithTimeout = withTimeout(
assetTestPromise,
Expand All @@ -40,7 +41,7 @@ export const getSingleAssetUrl = async (
} catch (err) {
if (err instanceof MediaError) {
let codec = ''
if (type === 'video') {
if (type === 'video' && !mobile) {
codec = getVideoCodec(distributionAssetUrl)
}
UserEventsLogger.logWrongCodecEvent(eventEntry, { assetType: type, ...(type === 'video' ? { codec } : {}) })
Expand Down
17 changes: 11 additions & 6 deletions packages/atlas/src/utils/getVideoCodec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,18 @@ export const getVideoCodec = async (url: string): string => {
const fetchRange = { start: 0, end: 8192 }
const arrayBuffer = await fetchPartialContent(url, fetchRange)
if (arrayBuffer) {
arrayBuffer.fileStart = 0
const mp4boxFile = mp4box.createFile()
mp4boxFile.appendBuffer(arrayBuffer)
mp4boxFile.flush()
try {
arrayBuffer.fileStart = 0
const mp4boxFile = mp4box.createFile()
mp4boxFile.appendBuffer(arrayBuffer)
mp4boxFile.flush()

const codec = mp4boxFile.getInfo()?.videoTracks[0]?.codec
return codec
const codec = mp4boxFile.getInfo()?.videoTracks[0]?.codec
return codec
} catch (error) {
ConsoleLogger.warn('Error parsing video codec:', error)
}
}

return ''
}

0 comments on commit 819457e

Please sign in to comment.