View Single Post
Old 11-17-2012, 02:37 PM   PM User | #6
rnd me
Senior Coder

 
rnd me's Avatar
 
Join Date: Jun 2007
Location: Urbana
Posts: 3,453
Thanks: 9
Thanked 466 Times in 450 Posts
rnd me is a jewel in the roughrnd me is a jewel in the roughrnd me is a jewel in the rough
Quote:
Originally Posted by Old Pedant View Post
Okay...looked at their FAQ. Not saying it couldn't be used for this, but it sure seems focussed on video and feels like overkill for a text-based game.

So I think your 6 months estimate is WILDLY optimistic. If they don't even have it working in Chrome, yet, how long do you REALLY think it will be before it becomes any kind of standard???
yeah, the docs leave a bit to be desired at this point. someone should write a book and make a fortune.
"rtc" in 2013 will be like "ajax" in 2006.

it's due in firefox 18, scheduled for early next year.
microsoft is onboard, but arguing over video and audio codecs.
frankly, i care a lot more about raw signaling than A/V.

now is the time to learn real time.
even if only in the shape of EventSource or WebSockets, real-time-communication is going to be big part of the web in the next few years, starting in the next few months.

i'm waiting for the APIs to solidify before i get into AV next year, but plain text events add a lot to basic apps. i've been playing with EventSource a lot these past few months, and while i know it's just the tip of the iceberg, i really love it. so far i've built a many-device synced music player, a notepad that's always the same on every tab/device that has it open, and a secure chat app.

at the risk of straying off topic (too late?),
networking can be much simpler than what you see on most of the examples out there. i have a public event server that handles all the back-end stuff so you can just write JS that talks to other JS. i am starting to look for devs to help me test this out for free for now. PM me and i'll be happy to provide the connection details and links to the documentation.


here is an example of a dead-simple app that changes the color of the screen and all the screens looking at the page.you could tuck an unused laptop on top of a book shelf, load this page, and "set the mood" with this app from your phone . or something like that; it's less code than a chat demo:

Code:
<input id="color" type="color" 
   onchange="net.broadcast('color', escape(this.value) )"   />

<script src="network.js"></script>
  
<script type='text/javascript'>
net = new Network("http://x.x.x.x:xxxx/colordemo/"); //connect to server

 //change color when event arrives
net.on("color",  function showColor( e ) { 
   document.body.style.backgroundColor= e.data ;
}); 
</script>
i'm not trying to push my particular script here, this code is virtually the same as EventSource(). My point is simply that it's ajax-simple to use "comet" these days, and it's widely supported right now.

looking forward, you can play with the webRTC API now using node.js emulator packages, and there are some client polyfills.
here's one example: http://code.google.com/p/webrtc4all/
and another https://github.com/kdomagal/Web-RTC

one last note,
i checked my chrome:
Code:
new webkitRTCPeerConnection(null)  ;
// console dump from chrome:
RTCPeerConnection
__proto__: RTCPeerConnection
addEventListener: function addEventListener() { [native code] } addIceCandidate: function addIceCandidate() { [native code] } addStream: function addStream() { [native code] } close: function close() { [native code] } constructor: function RTCPeerConnection() { [native code] } createAnswer: function createAnswer() { [native code] } createDataChannel: function createDataChannel() { [native code] } createOffer: function createOffer() { [native code] } dispatchEvent: function dispatchEvent() { [native code] } getStats: function getStats() { [native code] } removeEventListener: function removeEventListener() { [native code] } removeStream: function removeStream() { [native code] } setLocalDescription: function setLocalDescription() { [native code] } setRemoteDescription: function setRemoteDescription() { [native code] } updateIce: function updateIce() { [native code] }
so it IS in chrome.
even if we had to use audio for some reason, the webaudio api would make writing a mo/dem pretty easy and fun.

consider turning a 1000hz sine wave on and off; simply sample for 2ms and Math.round(amplitude at 1k). if it's not the same as before, raise() the change event.

while that's only a 250bps scheme, less than an old 300 baud modem, the important thing to me is just getting a message waiting clients as soon as possible, and one bit is enough. you can ajax for specifics at the moment data becomes available if need be...
__________________
my site (updated 5/13)
STATS (2013/5) HTML5:90.2% MOB:14% IE7:0.5% IE8:8.6% IE9:9.8% IE10:10%
rnd me is offline   Reply With Quote