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

Can't play video files anymore after upgrade to v0.19 #5539

Closed
sica07 opened this issue Dec 9, 2016 · 7 comments
Closed

Can't play video files anymore after upgrade to v0.19 #5539

sica07 opened this issue Dec 9, 2016 · 7 comments

Comments

@sica07
Copy link

sica07 commented Dec 9, 2016

Hi!
I upgraded our app from v0.17.4 to v0.19 (on Linux) and videos are not played anymore.
The error we get is:
Uncaught (in promise) DOMException: Failed to load because no supported source was found.
What we are doing is, uploada file as a blob and play it.

nw.Window.open('video.html', {}, function(win){
    win.enterFullscreen();
    win.on('enter-fullscreen',function(win){
        var video = this.window.document.querySelector('video')
            try{
                video.src = URL.createObjectURL(fileObj);
                video.play();
            }catch(e) {
                ukNotify(e, 0)
            }
         video.webkitRequestFullscreen();
    });     
});          

Any idea why is this happening now?

@rogerwang
Copy link
Member

Could you please provide a full case so we can reproduce it here?

@sica07
Copy link
Author

sica07 commented Dec 9, 2016

Of course:

<!DOCTYPE html>
<html>
    <head>
        <script src="vendor/jquery.min.js"></script>
    </head>
    <body>
        <button>Play</button>
        <input type="file" id="videoFile1" accept="video/mp4">
        <script>
            $(document).ready(function(){
                var videoFile;
                $("input").on('change',function(evt){
                    videoFile = evt.currentTarget.files[0];
                })
                $("button").click(function(){
                    var fileURL = URL.createObjectURL(videoFile);
                    nw.Window.open('video.html', {}, function(win){
                        win.enterFullscreen();
                        win.on('enter-fullscreen',function(win){
                            video = this.window.document.querySelector('video')
                                try{
                                    video.src = fileURL;
                                    video.play();
                                }catch(e) {
                                    //    ukNotify(e, 0)
                                }
                            video.webkitRequestFullscreen();
                        })
                    });
                });
            });
        </script>
    </body>
</html>

The video.html file is a plain html file with a <video autplay type="video/mp4"></video> element in it.

@Blatman
Copy link

Blatman commented Dec 9, 2016

FWIW, tried this on OSX with 0.19.1 and got the same but realized I needed to upgrade the libffmpeg.dylib to an mp4 capable version - worked fine (crashes on 0.20a1 tho')

@sica07
Copy link
Author

sica07 commented Dec 9, 2016 via email

@rogerwang
Copy link
Member

@scia07 as reported by @Blatman I think you need another ffmpeg library -- the official one won't play mp4.

@sica07
Copy link
Author

sica07 commented Dec 12, 2016

@rogerwang I don't understand what do you mean by that. I know that nwjs has the chromium ffmpeg library built in it. How can I use another ffmpeg library? How can I include it in nwjs?

@rogerwang
Copy link
Member

We don't distribute the proprietary codecs as we don't have the license. Read more here: http://docs.nwjs.io/en/latest/For%20Developers/Enable%20Proprietary%20Codecs/

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

3 participants