Sha256: 226bc321e6f947d37df18711ca832aaba01aedad8ee885e5f4d4084f4af5f250

Contents?: true

Size: 954 Bytes

Versions: 4

Compression:

Stored size: 954 Bytes

Contents

$ ->
  $(window).bind('body_loaded',
    =>
      new PhotoBooth()
  )



class PhotoBooth

  constructor: ->
    #@init_stream()
    navigator.getUserMedia = navigator.webkitGetUserMedia || navigator.getUserMedia;
    window.URL = window.URL || window.webkitURL;
    navigator.getUserMedia('video', 
      (par) =>
        @got_stream(par)
    )
    $("#blur, #brightness,#contrast,#hue-rotate,#hue-rotate2,#hue-rotate3,#saturate,#grayscale,#sepia,#invert").click(
      (event) =>
        cl = $(event.currentTarget).attr('id')
        if $("#content").hasClass(cl)
          $("#content").removeClass(cl)
        else
          $("#content").addClass(cl)
        return false
    )

  got_stream: (stream) =>
    video = $("#content")[0]
    $("#content").width($(window).width())
    $("#content").height($(window).height() - 50)
    console.log video
    console.log stream
    video.src = stream
    video.src = window.URL.createObjectURL(stream)

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
daftos-0.4.1 lib/apps/photobooth/coffee/photobooth.coffee
daftos-0.4.0 lib/apps/photobooth/coffee/photobooth.coffee
daftos-0.3.0 lib/apps/photobooth/coffee/photobooth.coffee
daftos-0.2.0 lib/apps/photobooth/coffee/photobooth.coffee