Skip to content

Instantly share code, notes, and snippets.

View floriangbh's full-sized avatar
🎯
Focusing

Florian Gabach floriangbh

🎯
Focusing
View GitHub Profile
class Layout {
enum Kind {
case layout1
case layout2
case layout3
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
}
override fun onResume() {
super.onResume()
val customView = CustomView(applicationContext)
//Create builder
LocalCamera localCamera = new LocalCamera(surfaceView)
//Start recording
if (localCamera.prepareAudio() && localCamera.prepareVideo()) {
localCamera.startRecord()
} else {
/**This device cant init encoders, this could be for 2 reasons: The encoder selected doesnt support any configuration setted or your device hasnt a H264 or AAC encoder (in this case you can see log error valid encoder not found)*/
}
//Stop recording
rtmpCamera1.stopStream()
class Layout {
enum Type {
case layout1
case layout2
case layout3
}
var type: Type = .layout1
var images: [UIImage?] = [nil, nil, nil, nil]
@floriangbh
floriangbh / UIImage+Extensions.swift
Last active January 23, 2017 13:41
Image compression
public extension UIImage {
func compress() -> UIImage? {
var actualHeight = self.size.height
var actualWidth = self.size.width
let maxHeight: CGFloat = 800.0
let maxWidth: CGFloat = 800.0
var imgRatio = actualWidth/actualHeight
let maxRatio = maxWidth/maxHeight
var compressionQuality: CGFloat = 0.6
# Pods for iOS_Firebase_Demo
pod 'Firebase/Core'
pod 'Firebase/Database'