Skip to content

Instantly share code, notes, and snippets.

2018-05-08 14:36:38.254 [Warn] [com.haishinkit.HaishinKit] [VideoIOComponent.swift:147] continuousExposure > exposureMode(2) is not supported
2018-05-08 14:36:38.255 [Warn] [com.haishinkit.HaishinKit] [VideoIOComponent.swift:88] continuousAutofocus > focusMode(2) is not supported
2018-05-08 14:36:38.281 [Info] [com.haishinkit.Exsample.iOS] [LiveViewController.swift:71] viewWillAppear > viewWillAppear
2018-05-08 14:36:38.285 [Info] [com.haishinkit.HaishinKit] [AACEncoder.swift:87] inSourceFormat > nil
2018-05-08 14:36:38.300 [Info] [com.haishinkit.HaishinKit] [VideoIOComponent.swift:35] fps > (fps: 30.0, duration: __C.CMTime(value: 100, timescale: 3000, flags: __C.CMTimeFla2018-05-08 14:36:49.117 [Trace] [com.haishinkit.HaishinKit] [RTMPSocket.swift:84] doOutput(chunk:locked:) > RTMPChunk{size: 0,type: zero,streamId: 3,message: Optional(RTMPCommandMessage{type: amf0Command,length: 246,streamId: 0,timestamp: 0,payload: 234 bytes,objectEncoding: 0,commandName: connect,transactionId: 1,commandObject: Optional(["v
diff --git a/Examples/iOS/LiveViewController.swift b/Examples/iOS/LiveViewController.swift
index 785799a..f56ae39 100644
--- a/Examples/iOS/LiveViewController.swift
+++ b/Examples/iOS/LiveViewController.swift
@@ -43,6 +43,8 @@ final class LiveViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
+
+ rtmpConnection.flashVer = "SomeCustomName"
@sfaxon
sfaxon / Connection.swift
Last active December 6, 2015 23:57
Swift router
public struct Connection {
public var request: HttpRequest
public var response: HttpResponseProtocol
public var urlParams: [(String, String)] = []
public init(request: HttpRequest) {
self.request = request
self.response = HttpResponse()
}
@sfaxon
sfaxon / gist:fca2807527c8aa87dfa0
Created August 13, 2015 01:39
Raspberry pi pin blink
import RPi.GPIO as GPIO
import time
print GPIO.VERSION
GPIO.setmode(GPIO.BOARD)
GPIO.setup(18, GPIO.OUT)
GPIO.output(18, True)
module Users
module RolesConfig #:nodoc:
# Users::Roles.module_roles returns:
# {"Users"=>[:admin], "Events"=>[:admin, :manager]}
attr_accessor :roles, :module_roles
def configure(&block)
if block_given?
calling_module = eval("self", block.binding)
if calling_module.to_s == "main"
@sfaxon
sfaxon / gist:bfc72f330b6396097646
Created February 15, 2015 17:41
select2 4.0.0 beta-3 createTag option
$(".select2").select2({
createTag: function (params) {
debugger;
return { id: params.term, text: params.term };
},
});
# Initializer where we inject the mock gateway into global variable AUTHNET_GATEWAY or setup the real client
if !Rails.env.production?
ActiveMerchant::Billing::Base.mode = :test
end
$using_mock_auth_net_gateway = false
# Use FORCE_AUTH_NET to use the real Auth.net API in tests
# Use MOCK_AUTH_NET to use the mock Auth.net API even in development (good on a plane!)
@sfaxon
sfaxon / gist:5104129
Created March 6, 2013 23:12
benchmark redis sorted set using zadd
r = Redis.connect(:url => 'redis://localhost:6379/2', :thread_safe => true)
k = 'livecount'
Benchmark.bm do |x|
x.report do
r.zrange(k,0,-1).count
end
x.report do
r.zremrangebyscore(k, 0, Time.now.to_i)
end
x.report do
@sfaxon
sfaxon / gist:3670345
Created September 7, 2012 22:36
dynamic assignment of dates
Post.class_eval do
columns.select { |c| c.type == :datetime }.map { |c| c.name }.each do |date_time_field|
class_eval <<-RUBY, __FILE__, __LINE__ + 1
def #{date_time_field}_date_picker
read_attribute(:#{date_time_field}).to_s(:date_picker)
end
def #{date_time_field}_time_picker
read_attribute(:#{date_time_field}).to_s(:time_picker)
end
def #{date_time_field}_date_picker=(date)
require 'debugger'
require 'bundler'
Bundler.setup
require 'typhoeus'
require 'faraday'
require File.join(File.dirname(__FILE__), 'lib/active_resource')
module ConnectDesk
module Request
class Auth < ::Faraday::Middleware