lvsti/CoreMediaIO-DAL-Example 129
Apple's CoreMediaIO DAL plugin example - modernized
Swift bindings for the Chromium Embedded Framework
Generate Swift interface for ObjC bridging headers
lvsti/Cameo 56
CMIO DAL plugin explorer
Developer-friendly Swift wrapper around the CoreMediaIO C APIs
Map scale view extension for the built-in iOS MKMapView
AirDrop for your clipboard
Mocking microframework for Swift
Localization helper tool for macOS
H.264 decoder in Haskell
startedlvsti/Bridgecraft
started time in 2 days
startedlvsti/Cameo
started time in 3 days
issue openedlvsti/CEF.swift
Try to load local file with Request Interception
Hi, I try to load a local html file with Request Interception but the browser remains desperately empty.
I have created a CEFRequestHandler :
class TestRequestHandler: CEFRequestHandler {
func onGetResourceRequestHandler(browser: CEFBrowser, frame: CEFFrame, request: CEFRequest, isNavigation: Bool, isDownload: Bool, initiator: String, disableDefault: inout Bool) -> CEFResourceRequestHandler? {
disableDefault = true
return TestResourceRequestHandler()
}
}
a CEFResourceRequestHandler :
class TestResourceRequestHandler: CEFResourceRequestHandler {
func cookieAccessFilter(browser: CEFBrowser?, frame: CEFFrame?, request: CEFRequest) -> CEFCookieAccessFilter? {
return nil
}
func resourceHandler(browser: CEFBrowser?, frame: CEFFrame?, request: CEFRequest) -> CEFResourceHandler? {
return TestResourceHandler()
}
func onResourceLoadComplete(browser: CEFBrowser?, frame: CEFFrame?, request: CEFRequest, response: CEFResponse, status: CEFURLRequestStatus, contentLength: Int64) {
print("Load Complete")
}
}
and a CEFResourceHandler :
class TestResourceHandler: CEFResourceHandler {
var fileData:Data?
var bytesDone:Int = 0
func onOpenResponseStream(request: CEFRequest, callback: CEFCallback) -> CEFOnOpenResponseStreamAction {
let fileManager = FileManager.default
var filePath = Bundle.main.resourcePath!
let url = request.url!.absoluteString
let index = url.index(url.startIndex, offsetBy: "http://localhost".characters.count)
filePath += url.substring(from:index)
if fileManager.fileExists(atPath: filePath) {
// Open the file
let file = FileHandle(forReadingAtPath: filePath)
fileData = file?.readDataToEndOfFile()
// Close the file
file?.closeFile()
} else {
print("File not found : " + filePath)
}
return .handle
}
func onGetResponseHeaders(response: CEFResponse) -> CEFOnGetResponseHeadersAction {
if fileData != nil{
response.status = 200;
response.statusText = "OK";
return .continueWithResponseLength(UInt64(fileData!.count))
}
return .abort
}
func onReadResponseData(buffer: UnsafeMutableRawPointer, bufferLength: Int, callback: CEFResourceReadCallback) -> CEFOnReadResponseDataAction {
let nsData = fileData! as NSData
let chunkSize = min(fileData!.count - bytesDone, bufferLength)
buffer.copyMemory(from: nsData.bytes.advanced(by: bytesDone), byteCount: chunkSize)
bytesDone += chunkSize
return .read(chunkSize)
}
}
The onResourceLoadComplete is called but nothing is displayed.
I probably forgot something but what ? Do you have a sample code with request intercetion ?
Thank you in advance
created time in 13 days
issue closedlvsti/CEF.swift
CEFResourceHandler does not seem to work as expected
Hi, I have a problem with CEFResourceHandler in branch cef_4280. The bufferLength parameter is not set correctly for onReadResponseData.
class TestResourceHandler: CEFResourceHandler { var fileData:Data? var bytesDone:Int = 0
func onOpenResponseStream(request: CEFRequest, callback: CEFCallback) -> CEFOnOpenResponseStreamAction {
let fileManager = FileManager.default
var filePath = Bundle.main.resourcePath!
let url = request.url!.absoluteString
let index = url.index(url.startIndex, offsetBy: "http://localhost".characters.count)
filePath += url.substring(from:index)
if fileManager.fileExists(atPath: filePath) {
// Open the file
let file = FileHandle(forReadingAtPath: filePath)
fileData = file?.readDataToEndOfFile()
// Close the file
file?.closeFile()
} else {
print("File not found : " + filePath)
}
return .handle
}
func onGetResponseHeaders(response: CEFResponse) -> CEFOnGetResponseHeadersAction {
if fileData != nil{
response.status = 200;
response.statusText = "OK";
return .continueWithResponseLength(UInt64(fileData!.count)) // Here value = 96
}
return .abort
}
func onReadResponseData(buffer: UnsafeMutableRawPointer, bufferLength: Int, callback: CEFResourceReadCallback) -> CEFOnReadResponseDataAction {
// Here bufferLength = 65536 expected -> 96
let nsData = fileData! as NSData
buffer.copyMemory(from: nsData.bytes.advanced(by: bytesDone), byteCount: bufferLength)
bytesDone += bufferLength
if bytesDone == UInt64(fileData!.count) {
return .complete
} else {
return .read(bufferLength)
}
}
}
Did I forget something? Do you have an example of use?
Thanks
closed time in 14 days
ebaujardissue commentlvsti/CEF.swift
CEFResourceHandler does not seem to work as expected
Hi, Thank you for your prompt response. I'm migrating from CEF 2924 to CEF 4280, it's disturbing to have the same parameter in these 2 versions with a different purpose.
comment created time in 14 days
startedlvsti/CoreMediaIO-DAL-Example
started time in 14 days
issue openedlvsti/CEF.swift
CEFResourceHandler does not seem to work as expected
Hi, I have a problem with CEFResourceHandler in branch cef_4280. The bufferLength parameter is not set correctly for onReadResponseData.
class TestResourceHandler: CEFResourceHandler { var fileData:Data? var bytesDone:Int = 0
func onOpenResponseStream(request: CEFRequest, callback: CEFCallback) -> CEFOnOpenResponseStreamAction {
let fileManager = FileManager.default
var filePath = Bundle.main.resourcePath!
let url = request.url!.absoluteString
let index = url.index(url.startIndex, offsetBy: "http://localhost".characters.count)
filePath += url.substring(from:index)
if fileManager.fileExists(atPath: filePath) {
// Open the file
let file = FileHandle(forReadingAtPath: filePath)
fileData = file?.readDataToEndOfFile()
// Close the file
file?.closeFile()
} else {
print("File not found : " + filePath)
}
return .handle
}
func onGetResponseHeaders(response: CEFResponse) -> CEFOnGetResponseHeadersAction {
if fileData != nil{
response.status = 200;
response.statusText = "OK";
return .continueWithResponseLength(UInt64(fileData!.count)) // Here value = 96
}
return .abort
}
func onReadResponseData(buffer: UnsafeMutableRawPointer, bufferLength: Int, callback: CEFResourceReadCallback) -> CEFOnReadResponseDataAction {
// Here bufferLength = 65536 expected -> 96
let nsData = fileData! as NSData
buffer.copyMemory(from: nsData.bytes.advanced(by: bytesDone), byteCount: bufferLength)
bytesDone += bufferLength
if bytesDone == UInt64(fileData!.count) {
return .complete
} else {
return .read(bufferLength)
}
}
}
Did I forget something? Do you have an example of use?
Thanks
created time in 18 days
startedlvsti/SevenZip
started time in 21 days
startedlvsti/Cameo
started time in a month
startedlvsti/CMIOKit
started time in a month
startedlvsti/CoreMediaIO-DAL-Example
started time in a month
startedlvsti/CMIOKit
started time in a month
startedlvsti/Cameo
started time in a month
startedlvsti/CoreMediaIO-DAL-Example
started time in a month
startedlvsti/Cameo
started time in a month
startedlvsti/CoreMediaIO-DAL-Example
started time in a month
startedlvsti/CEF.swift
started time in 2 months
startedlvsti/CoreMediaIO-DAL-Example
started time in 2 months
startedlvsti/Cameo
started time in 2 months
fork superworldapp/CoreMediaIO-DAL-Example
Apple's CoreMediaIO DAL plugin example - modernized
fork in 2 months
startedlvsti/CoreMediaIO-DAL-Example
started time in 2 months
issue closedlvsti/Audit
Why Break points are not hitting?
Hello, I tried to debug a plugin using Audit. it does not work? Can't I debug this like a core media IO DAL video plugin?
closed time in 2 months
Raj123456788issue commentlvsti/Audit
Why Break points are not hitting?
This is the only way for now https://github.com/kyleneideck/BackgroundMusic/blob/master/DEVELOPING.md#building-and-debugging
comment created time in 2 months
startedlvsti/CoreMediaIO-DAL-Example
started time in 2 months
startedlvsti/CMIOKit
started time in 2 months
startedlvsti/Cameo
started time in 2 months
startedlvsti/CoreMediaIO-DAL-Example
started time in 2 months
startedlvsti/CoreMediaIO-DAL-Example
started time in 2 months