Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

webm format that attached with rest API not preview in issue attachments

naseriimahmoud
Contributor
September 1, 2021

Hi everyone
I am creating a video in webm format in the program code, I download the file created from mediaRecorder without any problems and it is played. The problem occurs when I send the same blob to Jira Cloud using the rest api, the file is attached to the issue, but the video file downloaded from the Jira panel is not previously played, while Jira can not create a preview of the file and display it. Give.
Webm file creation code:

Capture1.PNG

tempsni2p.png

blobs = [];

rec = new MediaRecorder(stream, {mimeType: 'video/webm; codecs=vp8,opus'});
rec.ondataavailable = (e) => blobs.push(e.data);
rec.onstop = async () => {
blob = new Blob(blobs, {type: 'video/webm'});
c.attachAPI(blob);
};

And attach the file code to the issue:

const form = new FormData();
form.append('file', blob, 'attach.webm');
const responseFile = await requestJira('/rest/api/3/issue/'+issueKey+'/attachments', {
method:'POST',
body: form,
headers:{
'Accept': 'application/json',
'X-Atlassian-Token': 'no-check',
'Content-Type':'application/json'
}
});
let res = await responseFile.json();

 Thank you for your help

1 answer

0 votes
naseriimahmoud
Contributor
September 3, 2021

is there any suggestion?

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events