Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Local video embedded doesn't render #20

Open
pathange-s opened this issue Mar 14, 2022 · 1 comment
Open

Local video embedded doesn't render #20

pathange-s opened this issue Mar 14, 2022 · 1 comment

Comments

@pathange-s
Copy link

Expected Behavior
Normal display / play of videos / images

Actual Behavior
When local videos are embedded in the .html file, the space is left blank and nothing is rendered

Steps to Reproduce the Problem

  1. Create a sample app.
  2. Edit the index.html file to add the following lines of code :
  3. Have any local-video.mp4 in resources/

For Video render :

      <p>Local video embed</p>
      <iframe src="./local-video.mp4" frameborder="0" allowfullscreen></iframe>
      </iframe>
      <p>Remote video embed</p>
      <iframe width="420" height="315"
      src="https://www.youtube.com/embed/tgbNymZ7vqY">
      </iframe> 

Specifications

  • NeutralinoJs Version: 3.3.0
  • NeutralinoJs CLI version: 4.4.0
  • Platform: Ubuntu 20.04
@grey4owl
Copy link

grey4owl commented May 9, 2022

I'm not entirely sure if this has a direct connection to neutrailnojs. I found that the same problem occurs in the safari browser and represents a problem with video encoding.

Tested solution:

1. Use handbrake to encode video with web optimization (screenshot).

  • Click on Open Source > Select your video.
  • Check Web Optimized checkbox.
  • Edit Save As output location.
  • Click on Start.

2. After encoding, rename your encoded video from my-video.m4v to my-video.mp4.

3. Then you can use it with iframe:

<iframe src="./my-video.mp4" frameborder="0" allowfullscreen></iframe>

However (if you using this outside neutralinojs) some browsers might support this way of importing a video with <iframe> but some will act towards the video as a file and attempt to download it (ref). The correct way to display a video is using the <video> tag:

<video width="320" height="240" controls>
  <source src="my-video.mp4" type="video/mp4">
</video>

@shalithasuranga shalithasuranga transferred this issue from neutralinojs/neutralinojs Nov 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants