2

I am working to develop a desktop application for PC using node-webkit. When I run the app with node-webkit everything works great with the exception of the mp4 videos. The html 5 video box pops up, but it is pure white and the controls are grayed-out in the same way it does if I provide a bad file path and run the app in chrome. An example piece of my index.html file:

            <div data-role="popup" id="popupVideo" data-overlay-theme="a" data-theme="c" data-tolerance="15,15" class="ui-content">
                <video width="497" height="298" style="max-width:100%;" controls>
                <source src="base/tutorialvideos//General_Tutorial.mp4" type="video/mp4">
                Your browser does not support the video tag.
                </video> 
            </div>




            <div class="ui-btn ui-btn-right">
                <a href="#popupVideo" data-rel="popup" data-position-to="window" data-role="button" data-icon="info" data-inline="true">Tutorial</a>
            </div>

I double-checked the file path several times, and tried all combinations of /, //, \, \ just to be sure. I tried using the full file path instead of the relative with the same results.

I then used a format converter to change one of the videos from .mp4 to .ogv with the same results.

What is really curious, is that I am pretty sure that it IS seeing the videos, because with the code as is posted above, the controls are semi-responsive. I can toggle between play and pause and drag the slider. When I drag the slider to the end, it shows the exact run-time of the video, but still no audio or video.

It just occured to me that jquery mobile could be messing it up, so I'll post this and run a test with pure html 5.

Thanks is advance for any info.

Jake Sellers
  • 2,350
  • 2
  • 21
  • 40
  • You can use wcjs-player. More details [here](http://stackoverflow.com/questions/20797828/node-webkit-how-to-play-avi-videos/36361961#36361961). – Vish Apr 01 '16 at 17:08

1 Answers1

3

node-webkit only supports patent "free" codecs out of the box. You can however enable mp4/h264 support which is described here: Using MP3 & MP4 (H.264) using the video & audio tags..

totymedli
  • 29,531
  • 22
  • 131
  • 165
richapps
  • 31
  • 1
  • 1
  • Just adding the @richapps answer. Copying `ffmpegsumo.dll` from a 32-bit Chrome is the quickest way to test mp3/mp4. But do pay attention to licensing requirements. – James Wong Feb 12 '14 at 08:21
  • 2
    I copied the ffmpegsumo.so file (on a mac) from Chrome to Node-Webkit, only to discover it was already there. But node-webkit still doesn't play mp4 files. What's going wrong? – Kokodoko Mar 14 '14 at 11:48
  • 1
    You need to replace the file with the one from Chrome. The file that comes with node-webkit does not support mp4. – Tiago Fael Matos Apr 02 '14 at 17:28
  • The link appears to have changed to https://github.com/nwjs/nw.js/wiki/Using-MP3-&-MP4-(H.264)-using-the--video--&--audio--tags – williamsowen Apr 29 '15 at 05:15