Development Issues For Videos



After we have done most of the development for images, the next thing we wanted to do was make sure the extension supports video files in a similar way.

The first thing we checked was whether HTML and Markdown allow video previews, and it turned out that they do.
We began with the webview, as the HTML looked like a solid place to start testing these formats.
We tried <video> tag (like here: https://www.w3schools.com/html/html5_video.asp) but it wasn't showing the video.
Then we tried to create a <iframe> tag but faces the same problem.
We also tried the <ambed> and <object> tags but neither worked.

So, we started looking for a solution to our problem. Sadly, we found a similar question to ours, which was responded by a vscode bot which confirmed that vscode doesn't support video preview of any sort.



After further investigation, we also learned that there is a way to load local images in a different way than what we did, using "asWebviewUri" function, as shown:



But this is only a solution if an image is saved inside the extension folder, which we can't guarantee, so we decided not to use it for now (even though it works for images and text files).

We realized that videos couldn't be displayed in our extension so we left it and started looking for how to view PDFs in webview.
We found a vscode extension which displays PDFs using a javascript library called "PDF.js" (github of the open source: https://github.com/mozilla/pdf.js#online-demo).

So, we understood that there should be a way to view PDF files (and maybe later, convert office files to PDF and view them as PDF as well) in vscode, but the question that rose was- how can we make sure that our extension will include this library for the end user that will be using our extension? can it be part of the extension downloading process? how does it work?

Those questions are yet to be answered, but we will be making some more research and update on any development!






Comments

Popular posts from this blog

Turorial- How to add a new feature

Little Bug Fix

Publishing First Beta & Refactoring The Code