I found a game online, or which the source code is here, and I wanted to mod it. However, after modding it online on Github for a while, I was being driven crazy, by the github pages load time and my browser cache, which seemed to defy all attempts at deletion.
Finally, I attempted to use NWjs to load it. But, now the audio doesn't play at all. How do I fix this?
Note, the sounds, like the ding and select noise play, but not the bgm. All of them are .ogg files.
I'm using windows 10.
Another note, I pushed my version to Github and then checked out the gh-pages, which worked. So it's probably a problem with NWjs or my computer or both.
You probably need proprietary codecs.
Easiest way:
Switch to the latest version supported by the prebuilts (currently 0.55.0)
https://github.com/iteufel/nwjs-ffmpeg-prebuilt/releases
Download the version you need, unzip, and place it with your NW.js files.
More details:
https://nwjs.readthedocs.io/en/latest/For%20Developers/Enable%20Proprietary%20Codecs/
I downloaded the files you linked. I put that folder inside another called "game". Made a game/package.json file with this:
{
"main": "c2-sans-fight-gh-pages/index.html",
"name": "example"
}
Downloaded the Win 64 SDK version of NW.js v0.55.0.
http://dl.nwjs.io/v0.55.0/nwjs-sdk-v0.55.0-win-x64.zip
Dumped those files into the game folder so nw.exe was next to package.json and then ran it, and it worked fine. All audio played normally. I did not need to pull in the modified ffmpeg at all.
I cleared all things I could find, so ~/AppData/Local/nwjs and ~AppData/Local/<projectname> and ~/AppData/Roaming/<projectname> all got deleted, then I ran it again and it worked.
EDIT: It seems that I have to re-delete the cache files again and again before each launch. Guess I'll write a python script to handle this.
Related
So I want to start using dc.js package to create a few dashboards, and I've found this tutorial:
https://github.com/austinlyons/dcjs-leaflet-untappd
I've downloaded the entire folder and attempted to open the html to see whether it works, but I only get some parts of the page (no data, no graphs, you can see the expected and gotten image attached). I've had the same problem with some other tutorials that I've found, and can't figure out why. I can open the page in the browser when it is a link like:
https://austinlyons.github.io/dcjs-leaflet-untappd/
Any ideas? I am using Chrome btw, but it doesn't work in IE either.
You need to run python -m SimpleHTTPServer in your terminal.
Try it yourself
If you want to play with the code as we go, I recommend downloading
the source code from this GitHub repository, navigating to the
directory where the files are located, and kicking off Python's
SimpleHTTP server so that you can see your visualization in your own
browser at http://localhost:8000 (If this is new for you, see this
link for a bit more information).
If anyone is interested there is a very nice workaround for those not willing to play around with a server. For some reason Firefox allows the opening of such pages, so one can test D3 and similar code in it without having to run a server.
I have a phonegap application which will need to take a zip archive of a webpage, unzip it, and display the output.
I have been looking around for ways to zip/unzip with phonegap and have been coming up short. Since it's all Js it seems like JsZip might hold an answer but their test suite has nothing on unzipping.
Does anyone have any advice on how to achieve this?
Edit for posterity: I DID ultimately get javascript unzipping working with zip.js and a bunch of wrapper code. It worked fine but is quite processor intensive. Unzipping a 15mb zip file in chrome on a desktop took about 40 seconds. For anything where performance is a concern (most things), I would recommend stepping down a level and using a component directly from ios/android.
cordova-plugin-zip worked for me. It supports native unzipping for iOS and Android.
https://github.com/MobileChromeApps/cordova-plugin-zip
See this one: http://cheeso.members.winisp.net/Unzip-Example.htm
More info: Unzipping files
If the JavaScript approach does not work you can always just write a Plugin.
I'm looking to play AVI files in a web browser however I can't seem to find a decent tool to do so.
The basic WMP object embed is what I'm using right now but it doesn't really do what I'd like it to do, and I can't really implement JavaScript into it. (AFAIK I can't. I done a little digging and that's the conclusion I came to)
I've also tried DivX though I don't really like it. It has adverts, and I've no idea if JavaScript can be included either.
AFAIK Flash doesn't support AVI playback at all.
Does anyone know of any player at all that can play AVI files on the web, which I could possibly integrate some kind of JavaScript in (or has an API)?
Just a thought too, but would Java itself have anything like this?
The player also needs to be able to source the files like this:
file:\\Network-PC-Name\avi\avifile.avi
What you're looking for is WebChimera, there's no doubt about it. It has the most complex JS API ever made for web video, and it supports all file types.. it also supports "file:///" (for links like file:///C:/avi/avifile.avi).
It is open source and has no advertising. And the best part is that everything inside the player is editable, so you can skin it, add buttons and even add entirely new features to it with mostly just JavaScript. :)
Update
As you mentioned you need it to connect to file:///Network-PC-Name/avi/avifile.avi, this tells me you need this for some Local / Private / LAN use.
In this case, I think the best solution for you is to use WebChimera with Node-Webkit, as it will also give you a JS API based server environment.
WebChimera Player is already ported to NW for Windows and Mac:
https://github.com/jaruba/WebChimeraPlayerNW
On Windows, just download the package, and run nw.exe. To customize just edit the html pages. For Mac, just follow the instructions in the Readme.md.
The great part about using it like this, is that it already has the plugin embedded in the app, so you won't even need to install the plugin for the player to work.
The only thing I can't be fully sure of, is if Network-PC-Name can even be accessed through the file:/// protocol in it's normal usage. But this would still be possible anyway as you could map the network drive, and you can even map it programatically (with only JavaScript!) by using the child process exec to run the necessary command. (child_process is built in node-webkit natively)
flowplayer is recommended by this post:
Flash video player for AVI files (free for commercial use)
not sure about the file:\ source, as that's on your local machine and could be refused by the browser for security reasons
I'm looking for a flash script/library to capture video and audio from a webcam and then somehow get a saved flv to my encoding server. I'm not looking for something that will host the videos for me. I just need something simple to capture and then upload. I really want this to be open source and free.
I've done a fair amount of searching and it seems that most of what i can find is either a full blown service with hosting, or the red 5 suite. I've been trying for a day to get something going on with Red5, but honestly I haven't done any flash or java development in over 6 years and this seems way too complicated when all i really want is a flash object i can stick on a webpage.
I've search google and github and am really surprised by the lack of simple options. Am I missing something obvious? Thanks.
I ended up going with Red 5 server and red5recorder. It was tricky to get everything working properly, but here's an overview of what I did:
Check out red5 version 0.9.1 (I couldn't get the latest version working with red5recorder). ant prepare; ant clean dist.
Download the latest source for red5recorder.
Install Eclipse Ganymede Sr2 (3.4.2) Enterprise Edition (the latest version that works with both the red5 plugin and the flash builder plugin).
Install the red5 plugin according to http://wiki.red5.org/wiki/Red5Plugin
Install the Adobe Flash Builder 4 plugin into eclipse-install-dir/flash-builder and built it against the eclipse in eclipse-install-dir
Create a New Dynamic Web Project. I named it Red5Server. Select a New Target Runtime -> Infared | Red5 Server. Target the dist directory in the red5 checkout. so for me:
auto deploy dir: /Users/julia/code/red5-0.9.1.svn/dist/webapps/
start script: /Users/julia/code/red5-0.9.1.svn/dist/red5-debug.sh
stop script: /Users/julia/code/red5-0.9.1.svn/dist/red5-shutdown.sh
Import Flash Builder Project - red5recorder
Right click Red5Server | Run as.. | Run on Server. It should start up the server and show Directory listing for localhost:5080/Red5Server
In red5recorder's Recorder class, change server to be rtmp://127.0.0.1/Red5Server/
Right click on red5recorder.mxml and run it as an application. It should pop up a browser and the recorder should successfully connect to your webcam.
Now, red5recorder is really broken out of the box. It required quite a bit of tweaking to get it to do what it says it will, and once I was more comfortable, I ended up refactoring it altogether to do what I wanted.
There are "simple" demo publish and playback examples for Flash in our source tree. When I say simple I mean dead-simple, have you looked into these?
Broadcast / publish - http://red5.googlecode.com/svn/flash/trunk/simpleBroadcaster.fla
Playback - http://red5.googlecode.com/svn/flash/trunk/simpleSubscriber.fla
Flash examples: http://red5.googlecode.com/svn/flash/trunk/
I'm currently evaluating and reading the rtmp-nginx-module. It looks more stable and very well documented than the other peers I've tried:
RTMPLite: Works well with VideoIO.swf however it's not easily extensible.
Red5: Good luck getting it working correctly!
I am captivated by the split-flap animation on Apple's 10 billion song download page. However, I have not been able to replicate it on my own machine. I have downloaded the script and what I believe is the appropriate css, but the page only displays 3 images of the number 0. Has anyone gotten the script to work off of the Apple site?
The script appears to call out to http://www.apple.com/autopush/us/itunes/includes/countdown.inc - are you hosting a local copy of that in the right location?
Someone has built a nice script to exactly replicate this.
I tried on my system and for some reason the IIS would choke on the countdown.inc file .. it would not load it.. i renamed it to countdown.htm, and changed the reference in the code to reflect this and it worked just fine...
Note that the animation is all done with a sprite:
http://images.apple.com/itunes/10-billion-song-countdown/images/counter_filmstrip20100211.png
Otherwise, are you debugging the page locally at all? Any .js errors in firebug?