Fix #197 timed text editor alignement for audio files#203
Conversation
Updating from BBC repo
removing functions to save and adding callback at parent component
only works with laodDemo, other import from computer etc.. still not addressed
…nscript-editor into fix-200-component-save
|
considered making the component check the media type of the url to determine the layout accordingly (more info here) however this seemed to slow down the loading of the page/component coz it has to load the file before being able to determine if it's audio or video. See below example of possible implementation in checkIfIsAudio = () => {
console.log('checkIfIsAudio');
if(this.props.mediaType === 'audio'){
this.setState({isAudio: true})
return true;
}
else{
this.setState({isAudio: false})
return false;
}
if (this.props.mediaUrl) {
console.log('mediaUrl',this.props.mediaUrl)
// from https://stackoverflow.com/questions/11876175/how-to-get-a-file-or-blob-from-an-object-url
let file = await fetch(this.props.mediaUrl);
const blob = await file.blob();
console.log('blob',blob);
console.log('type',blob.type);
if (blob.type.includes("audio")){
console.log('is audio')
this.setState({isAudio: true})
return true;
}
console.log('is not audio')
this.setState({isAudio: false})
return false;
}
return false;
};Then decided it might be better to just pass |
|
In this PR branch you can see the changes in the storybook under
For audio only - desktopAudio only - mobileAudio - iPad portraitAudio - iPad landscapeVideo - desktopVideo - mobile |
emettely
left a comment
There was a problem hiding this comment.
Awesome changes, looks really good. I wonder if you could look for example something like the extension to determine the audio / video file as well.
Co-Authored-By: Eimi Okuno <emettely@users.noreply.github.com>






Is your Pull Request request related to another issue in this repository ?
#197
Describe what the PR does
mediaTypeNote that this PR branches off #201 as a base
State whether the PR is ready for review or whether it needs extra work
Ready for review
Additional context
In current master when using an audio file with
TranscriptEditorthe layout looks a bit off, there is an empty column where the video preview would have been.still to do
TranscriptEditor-->audioview.