Giter Club home page Giter Club logo

talking_stick's People

Contributors

benlangfeld avatar bklang avatar bryanrite avatar etagwerker avatar hpjaj avatar lpradovera avatar webdevlyna avatar xjunior avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

talking_stick's Issues

Rails 5.0 Support

Hi,

I think it'd be great if talking_stick was compatible with Rails 5.0

Right now I see that this is the version requirement:

talking_stick depends on rails (< 5.0, > 3.0)

Ernesto

NameError in TalkingStick::RoomsController#create

Started POST "/talking_stick/rooms" for 192.168.2.1 at 2015-09-22 03:09:12 +0000
Cannot render console from 192.168.2.1! Allowed networks: 127.0.0.1, ::1, 127.0.0.0/127.255.255.255
Processing by TalkingStick::RoomsController#create as HTML
  Parameters: {"utf8"=>"โœ“", "authenticity_token"=>"fWCI3ueYEikOYz6R0GlPcQwdtUoBDsrgaoHgzhuDveik/Bfh5dI/QsrMHdXmCPUe/Rgm35nVhzmcGjawK4Jdgw==", "room"=>{"name"=>"Create new room"}, "commit"=>"Save"}
   (0.1ms)  begin transaction
   (0.2ms)  rollback transaction
Completed 500 Internal Server Error in 6ms (ActiveRecord: 0.3ms)


NameError (undefined local variable or method `slug' for #<TalkingStick::Room:0x007ff4e549d0b8>):
  activemodel (4.2.3) lib/active_model/attribute_methods.rb:433:in `method_missing'
  /home/vagrant/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/bundler/gems/talking_stick-1d8e9a183865/app/models/talking_stick/room.rb:20:in `sluggify_name'
  activesupport (4.2.3) lib/active_support/callbacks.rb:430:in `block in make_lambda'
  activesupport (4.2.3) lib/active_support/callbacks.rb:162:in `call'
  activesupport (4.2.3) lib/active_support/callbacks.rb:162:in `block in halting'
  activesupport (4.2.3) lib/active_support/callbacks.rb:502:in `call'
  activesupport (4.2.3) lib/active_support/callbacks.rb:502:in `block in call'
  activesupport (4.2.3) lib/active_support/callbacks.rb:502:in `each'
  activesupport (4.2.3) lib/active_support/callbacks.rb:502:in `call'
  activesupport (4.2.3) lib/active_support/callbacks.rb:88:in `run_callbacks'
  activemodel (4.2.3) lib/active_model/validations/callbacks.rb:113:in `run_validations!'
  activemodel (4.2.3) lib/active_model/validations.rb:334:in `valid?'
  activerecord (4.2.3) lib/active_record/validations.rb:58:in `valid?'
  activerecord (4.2.3) lib/active_record/validations.rb:83:in `perform_validations'
  activerecord (4.2.3) lib/active_record/validations.rb:37:in `save'
  activerecord (4.2.3) lib/active_record/attribute_methods/dirty.rb:21:in `save'
  activerecord (4.2.3) lib/active_record/transactions.rb:286:in `block (2 levels) in save'
  activerecord (4.2.3) lib/active_record/transactions.rb:351:in `block in with_transaction_returning_status'
  activerecord (4.2.3) lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `block in transaction'
  activerecord (4.2.3) lib/active_record/connection_adapters/abstract/transaction.rb:184:in `within_new_transaction'
  activerecord (4.2.3) lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `transaction'
  activerecord (4.2.3) lib/active_record/transactions.rb:220:in `transaction'
  activerecord (4.2.3) lib/active_record/transactions.rb:348:in `with_transaction_returning_status'
  activerecord (4.2.3) lib/active_record/transactions.rb:286:in `block in save'
  activerecord (4.2.3) lib/active_record/transactions.rb:301:in `rollback_active_record_state!'
  activerecord (4.2.3) lib/active_record/transactions.rb:285:in `save'
  /home/vagrant/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/bundler/gems/talking_stick-1d8e9a183865/app/controllers/talking_stick/rooms_controller.rb:52:in `create'
  actionpack (4.2.3) lib/action_controller/metal/implicit_render.rb:4:in `send_action'
  actionpack (4.2.3) lib/abstract_controller/base.rb:198:in `process_action'
  actionpack (4.2.3) lib/action_controller/metal/rendering.rb:10:in `process_action'
  actionpack (4.2.3) lib/abstract_controller/callbacks.rb:20:in `block in process_action'
  activesupport (4.2.3) lib/active_support/callbacks.rb:115:in `call'
  activesupport (4.2.3) lib/active_support/callbacks.rb:115:in `call'
  activesupport (4.2.3) lib/active_support/callbacks.rb:553:in `block (2 levels) in compile'
  activesupport (4.2.3) lib/active_support/callbacks.rb:503:in `call'
  activesupport (4.2.3) lib/active_support/callbacks.rb:503:in `call'
  activesupport (4.2.3) lib/active_support/callbacks.rb:88:in `run_callbacks'
  actionpack (4.2.3) lib/abstract_controller/callbacks.rb:19:in `process_action'
  actionpack (4.2.3) lib/action_controller/metal/rescue.rb:29:in `process_action'
  actionpack (4.2.3) lib/action_controller/metal/instrumentation.rb:32:in `block in process_action'
  activesupport (4.2.3) lib/active_support/notifications.rb:164:in `block in instrument'
  activesupport (4.2.3) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
  activesupport (4.2.3) lib/active_support/notifications.rb:164:in `instrument'
  actionpack (4.2.3) lib/action_controller/metal/instrumentation.rb:30:in `process_action'
  actionpack (4.2.3) lib/action_controller/metal/params_wrapper.rb:250:in `process_action'
  activerecord (4.2.3) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
  actionpack (4.2.3) lib/abstract_controller/base.rb:137:in `process'
  actionview (4.2.3) lib/action_view/rendering.rb:30:in `process'
  actionpack (4.2.3) lib/action_controller/metal.rb:196:in `dispatch'
  actionpack (4.2.3) lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
  actionpack (4.2.3) lib/action_controller/metal.rb:237:in `block in action'
  actionpack (4.2.3) lib/action_dispatch/routing/route_set.rb:76:in `call'
  actionpack (4.2.3) lib/action_dispatch/routing/route_set.rb:76:in `dispatch'
  actionpack (4.2.3) lib/action_dispatch/routing/route_set.rb:45:in `serve'
  actionpack (4.2.3) lib/action_dispatch/journey/router.rb:43:in `block in serve'
  actionpack (4.2.3) lib/action_dispatch/journey/router.rb:30:in `each'
  actionpack (4.2.3) lib/action_dispatch/journey/router.rb:30:in `serve'
  actionpack (4.2.3) lib/action_dispatch/routing/route_set.rb:821:in `call'
  railties (4.2.3) lib/rails/engine.rb:518:in `call'
  railties (4.2.3) lib/rails/railtie.rb:194:in `public_send'
  railties (4.2.3) lib/rails/railtie.rb:194:in `method_missing'
  actionpack (4.2.3) lib/action_dispatch/routing/mapper.rb:51:in `serve'
  actionpack (4.2.3) lib/action_dispatch/journey/router.rb:43:in `block in serve'
  actionpack (4.2.3) lib/action_dispatch/journey/router.rb:30:in `each'
  actionpack (4.2.3) lib/action_dispatch/journey/router.rb:30:in `serve'
  actionpack (4.2.3) lib/action_dispatch/routing/route_set.rb:821:in `call'
  rack (1.6.4) lib/rack/etag.rb:24:in `call'
  rack (1.6.4) lib/rack/conditionalget.rb:38:in `call'
  rack (1.6.4) lib/rack/head.rb:13:in `call'
  actionpack (4.2.3) lib/action_dispatch/middleware/params_parser.rb:27:in `call'
  actionpack (4.2.3) lib/action_dispatch/middleware/flash.rb:260:in `call'
  rack (1.6.4) lib/rack/session/abstract/id.rb:225:in `context'
  rack (1.6.4) lib/rack/session/abstract/id.rb:220:in `call'
  actionpack (4.2.3) lib/action_dispatch/middleware/cookies.rb:560:in `call'
  activerecord (4.2.3) lib/active_record/query_cache.rb:36:in `call'
  activerecord (4.2.3) lib/active_record/connection_adapters/abstract/connection_pool.rb:653:in `call'
  activerecord (4.2.3) lib/active_record/migration.rb:377:in `call'
  actionpack (4.2.3) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
  activesupport (4.2.3) lib/active_support/callbacks.rb:84:in `run_callbacks'
  actionpack (4.2.3) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
  actionpack (4.2.3) lib/action_dispatch/middleware/reloader.rb:73:in `call'
  actionpack (4.2.3) lib/action_dispatch/middleware/remote_ip.rb:78:in `call'
  actionpack (4.2.3) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
  web-console (2.2.1) lib/web_console/middleware.rb:31:in `call'
  actionpack (4.2.3) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
  railties (4.2.3) lib/rails/rack/logger.rb:38:in `call_app'
  railties (4.2.3) lib/rails/rack/logger.rb:20:in `block in call'
  activesupport (4.2.3) lib/active_support/tagged_logging.rb:68:in `block in tagged'
  activesupport (4.2.3) lib/active_support/tagged_logging.rb:26:in `tagged'
  activesupport (4.2.3) lib/active_support/tagged_logging.rb:68:in `tagged'
  railties (4.2.3) lib/rails/rack/logger.rb:20:in `call'
  actionpack (4.2.3) lib/action_dispatch/middleware/request_id.rb:21:in `call'
  rack (1.6.4) lib/rack/methodoverride.rb:22:in `call'
  rack (1.6.4) lib/rack/runtime.rb:18:in `call'
  activesupport (4.2.3) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
  rack (1.6.4) lib/rack/lock.rb:17:in `call'
  actionpack (4.2.3) lib/action_dispatch/middleware/static.rb:116:in `call'
  rack (1.6.4) lib/rack/sendfile.rb:113:in `call'
  railties (4.2.3) lib/rails/engine.rb:518:in `call'
  railties (4.2.3) lib/rails/application.rb:165:in `call'
  rack (1.6.4) lib/rack/lock.rb:17:in `call'
  rack (1.6.4) lib/rack/content_length.rb:15:in `call'
  rack (1.6.4) lib/rack/handler/webrick.rb:88:in `service'
  /home/vagrant/.rbenv/versions/2.2.2/lib/ruby/2.2.0/webrick/httpserver.rb:138:in `service'
  /home/vagrant/.rbenv/versions/2.2.2/lib/ruby/2.2.0/webrick/httpserver.rb:94:in `run'
  /home/vagrant/.rbenv/versions/2.2.2/lib/ruby/2.2.0/webrick/server.rb:294:in `block in start_thread'

Could not find generator 'talking_stick:views

Log
Rails 4.2.3 and ruby 2.2.2

[vagrant|4.2.3#2.2.2] /Projects/calling
$ rails g talking_stick:views
Could not find generator 'talking_stick:views'. Maybe you meant 'assets', 'integration_test' or 'migration'
Run rails generate --help for more options.

Remote video is not appearing

Hi All,

I am trying to integrate talking_stick to my rails application. I followed all the steps from the readme. But I have a problem. My partner video is not appearing.

Is there anything that I messed?
Thanks in advance.

Signaling Error

When I launch the rails server and try to get into chat room I get this error :

undefined method `where' for Signal:Module

This is the ChatRoom Controller

class ChatRoomsController < ApplicationController

  before_action :set_chat_room, only: [:show, :edit, :update, :destroy, :signal]
  before_action :set_participant, only: [:signal]

  def index
    @chat_rooms = ChatRoom.all
  end

  def new
    @chat_room = ChatRoom.new
  end


  def create
      @chat_room = current_user.chat_rooms.build(chat_room_params)
    if @chat_room.save
      flash[:success] = 'Chat room added!'
      redirect_to chat_rooms_path
    else
      render 'new'
    end
  end

  def edit
  end

  def update
    if @chat_room.update(chat_room_params)
      redirect_to @chat_room, notice: 'Room was successfully updated.'
    else
      render :edit
    end
  end

  def show
    @chat_room.last_used = Time.now
    @chat_room.save

    if params[:guid]
      if @participant = Participant.where(guid: params[:guid]).first
        @participant.last_seen = Time.now
        @participant.save
      end
    end

    Participant.remove_stale! @chat_room

    response = {
        chat_room: @chat_room,
        participants: @chat_room.participants,
        signals: deliver_signals,
    }


    respond_to do |format|
      format.html
      format.json { render json: response }
    end
  end


  def destroy
    @chat_room.destroy
    redirect_to chat_room_url, notice: 'Room was successfully destroyed.'
  end

  def signal
    signal = signal_params
    signal[:chat_room] = @chat_room
    signal[:sender] = Participant.where(guid: signal[:sender]).first
    signal[:recipient] = @participant
    Signal.create! signal

    head 204
  end

  def deliver_signals

    data = Signal.where recipient: @participant


    result = []
    data.each do |signal|
      result << {
          signal_type: signal.signal_type,
          sender_guid: signal.sender_guid,
          recipient_guid: signal.recipient_guid,
          data: signal.data,
          chat_room_id: signal.chat_room_id,
          timestamp: signal.created_at,
      }
    end
    data.delete_all
    result
  end

  private

  def chat_room_params
    params.require(:chat_room).permit(:title, :last_used)
  end

  def set_chat_room
    @chat_room = ChatRoom.find_or_create(slug: (params[:id] || params[:chat_room_id]))
  end

  def set_participant
    @participant = Participant.find(params[:participant_id])
  rescue ActiveRecord::RecordNotFound

    @participant = Participant.where(guid: params[:participant_id]).first
    raise unless @participant

  end


  def signal_params
    params.permit(:sender, :signal_type, :data)
  end
end

Participant Controller

class ParticipantsController < ApplicationController
    before_action :set_chat_room
    before_action :set_participant, only: [:show, :edit, :update, :destroy]

    # GET /participants
    # GET /participants.json
    def index
      @participants = Participant.all
    end

    # GET /participants/1
    # GET /participants/1.json
    def show
    end

    # GET /participants/new
    def new
      @participant = Participant.new
    end

    # GET /participants/1/edit
    def edit
    end

    # POST /participants
    # POST /participants.json

    def create
      params = participant_params.merge ip: request.remote_ip
      @participant = Participant.new(params)
      @participant.chat_room = @chat_room

      respond_to do |format|
        if @participant.save
          format.html { redirect_to [@chat_room, @participant], notice: 'Participant was successfully created.' }
          format.json { render json: @participant }
        else
          render :new
        end
      end
    end

    # PATCH/PUT /participants/1
    # PATCH/PUT /participants/1.json
    def update
      respond_to do |format|
        if @participant.update(participant_params)
          format.html { redirect_to @participant, notice: 'Participant was successfully updated.' }
          format.json { render :show, status: :ok, location: @participant }
        else
          format.html { render :edit }
          format.json { render json: @participant.errors, status: :unprocessable_entity }
        end
      end
    end

    # DELETE /participants/1
    # DELETE /participants/1.json
    def destroy
      @participant.destroy
      respond_to do |format|
        format.html { redirect_to participants_url, notice: 'Participant was successfully destroyed.' }
        format.json { head :no_content }
      end
    end


    private
      # Use callbacks to share common setup or constraints between actions.
    def set_participant
      @participant = Participant.find params[:id]
    end

      def set_chat_room
        @chat_room = ChatRoom.find_by(slug: params[:chat_room_id])
      end

      # Never trust parameters from the scary internet, only allow the white list through.
      def participant_params
        params.require(:participant).permit(:name, :ip, :joined_at, :last_seen, :guid)
      end
  end

Signal Model

class Signal < ApplicationRecord
  belongs_to :chat_room
  belongs_to :sender, class_name: 'Participant', index: true
  belongs_to :recipient, class_name: 'Participant', index: true
  validates :chat_room, :sender, :recipient, presence: true

  default_scope { order 'created_at ASC' }

  # The normal delegate method seems to not be working for an unknown reason
  def sender_guid
    self.sender.guid
  end

  def recipient_guid
    self.recipient.guid
  end
end

Participant Model

class Participant < ApplicationRecord
  belongs_to :chat_room
  has_many :signals_sent, class_name: 'Signal', foreign_key: 'sender_id', dependent: :destroy
  has_many :signals_received, class_name: 'Signal', foreign_key: 'recipient_id', dependent: :destroy
  before_save :set_defaults

  def set_defaults
    self.joined_at ||= Time.now
    self.last_seen ||= self.joined_at
  end

  class << self
    def remove_stale!(room)
      self.where(chat_room: room).where('last_seen < ?', Time.now - 15.seconds).destroy_all
    end
  end
end

Could not find generator 'talking_stick:views'.

Hi,

Could you please help in solving this issue?

suramai@rails-tutorial:~/workspace/testingwebrtc (master) $ rails generate talking_stick:views
Running via Spring preloader in process 188485
Could not find generator 'talking_stick:views'. Maybe you meant 'assets', 'migration' or 'test_unit:job'
Run `rails generate --help` for more options.
suramai@rails-tutorial:~/workspace/testingwebrtc (master) $ bundle exec spring binstub --all
* bin/rake: spring already present
* bin/rails: spring already present
suramai@rails-tutorial:~/workspace/testingwebrtc (master) $ rails generate talking_stick:views
Running via Spring preloader in process 188527
Could not find generator 'talking_stick:views'. Maybe you meant 'assets', 'migration' or 'test_unit:job'
Run `rails generate --help` for more options.
suramai@rails-tutorial:~/workspace/testingwebrtc (master) $ 

Thanks

WebRTC one to many

Today do not have any option that can be made a livestream? A transmission from one to several?

Thanks for the lib

Helpers and routes not being detected in the talking_stick views

Hello,

Could you please share how I can access the helpers and routes inside the talking stick views?

Started GET "/talking_stick/rooms" for 142.105.174.115 at 2016-01-17 01:26:23 +0000
  ActiveRecord::SchemaMigration Load (0.3ms)  SELECT "schema_migrations".* FROM "schema_migrations"
Processing by TalkingStick::RoomsController#index as HTML
  TalkingStick::Room Load (0.4ms)  SELECT "talking_stick_rooms".* FROM "talking_stick_rooms"
  Rendered talking_stick/rooms/index.html.erb within layouts/application (53.3ms)
Completed 500 Internal Server Error in 554ms (ActiveRecord: 1.3ms)

NoMethodError (undefined method `full_title' for #<#<Class:0x00000008c82668>:0x00000008c75508>):
  app/views/layouts/application.html.erb:22:in `_app_views_layouts_application_html_erb___4228776872201960948_73395740'

It works if I removes all the helpers and path variables from the navbar, footer and application layout.

ICE failed

On Firefox I am not able to see the remote video when I connected from different notwork.

Found following error:
ICE failed, see about:webrtc for more details

Anyone help me.
Is this due to the SSL certificate or any other reason.

Rails InvalidAuthenticityToken on joining room

Hi,

I have an issue with the InvalidAuthenticityToken. Where can I add the token that rails accept the create when I click on 'join' for a room ? I tried to put it in 'options' var but it doesn't work, nothing happens, on clincking the 'join' room button, it trigger the 'create' method but I need to add the token in the params sent to this method, but I can't unfortunately.

And by the way, do you have a documentation or something like this please ? I'm new to WebRTC and I don't get it how I have to use it and moreover how I have to use your gem.

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.