bdkjones / CodeKit

CodeKit 3 Issue Tracker
https://codekitapp.com
82 stars 5 forks source link

Cannot play local video #455

Closed xcrap closed 6 years ago

xcrap commented 6 years ago

I cannot play any local video with in my localhost, sometimes it plays some seconds and stops sometimes it does not play nothing...

bdkjones commented 6 years ago

Please send me the project in question and all files I need to duplicate the issue over here.

xcrap commented 6 years ago

http://www.waka.pt/villaboscana.zip It's available here.

It works great on http://villaboscana.local (From Mamp) but fails at http://xcrap:5757 (Codekit) I'm having this issue with all my projects that includes local videos, using direct video tags, slideshows, Plyr, basically anything that includes videos.

bdkjones commented 6 years ago

Hmm. So your test project works flawlessly in Safari and Firefox. I do see the problem you reported in Chrome when using the Preview Server addresses. And I do see that Chrome plays the video fine when viewed on MAMP directly.

I don't know if this is a CodeKit issue or a Chrome issue. Can you remove all the ancillary JavaScript junk around the video and eliminate that from the page? It reduces variables—whatever all that JavaScript is could be the culprit on Chrome.

bdkjones commented 6 years ago

Firefox does stop playing after a while with this error:

screen shot 2018-04-09 at 18 26 05

xcrap commented 6 years ago

If you remove all the JS it will play fine.

<video src="videos/villaboscana.mp4" poster="videos/villaboscana_poster.jpg" id="video_loop" preload"auto" autoplay muted loop>

Something like this with Codekit server will work perfectly. This problem comes with the introduction of any JS video player or slideshow, I've tested like I told, Plyr or MasterSlideshow, this are big scripts that I use in a lot of projects and whenever they play the local videos it hangs in Chrome. You're right, it's working well in Safari and Opera, just failing on Firefox and Chrome, beeing Chrome my n1 test tool. I don't get it why it's only with local files, makes no sense but in deed only happens with additional scripts :\

bdkjones commented 6 years ago

I don't know, but right off the bat I don't see any obvious reasons the failure would be happening. Chrome has gotten really aggressive about limiting autoplay on video/audio, so I'm wondering if that could be an explanation?

I'm also wondering if this is specific to CodeKit or if ANY reverse-proxy setup would trigger the problem in the JS. I don't know of another tool that will easily let you set up a reverse proxy to test that theory though.

xcrap commented 6 years ago

I'll keep checking future updates of Chrome and also this scripts to see if it makes any difference or even others to see how they react, or if I discover something new that is relevant I'll let you know. Thanks. Back to remote streaming testing :)

bdkjones commented 6 years ago

The other option is to preview in Safari! Way better battery life than Chrome, and a faster browser to boot. The web inspector is not as good, but you can use Chrome's for that.