Skip to content

Instantly share code, notes, and snippets.

@dmlap
Created October 19, 2012 14:48
Show Gist options
  • Select an option

  • Save dmlap/3918603 to your computer and use it in GitHub Desktop.

Select an option

Save dmlap/3918603 to your computer and use it in GitHub Desktop.
Using the event logger with a BC iOS Player
/* Create an event logger for a player. Note how we attach it to the event emitter for a player. You can attach the logger to the catalog's event emitter as well! */
BCEventLogger *playerLogger = [[BCEventLogger alloc]initWithEventEmitter:player.playbackEmitter];
/* If you're in verbose mode, this string will be prepended to all the logging */
[playerLogger setLoggingPrefix:@"Player"];
/* The logger is verbose by default and prints out every event and all the properties of that event. Non-verbose mode just prints out the event name */
playerLogger.verbose = false;
/* We don't recommend leaving this on for "production" code but it can be handy to know what component sent a particular event when debugging. If you add this line, the sender will be printed out as well. */
[player.playbackEmitter
emit:BCEventSetDebug
withDetails:[NSDictionary
dictionaryWithObject:[NSNumber numberWithBool:YES]
forKey:@"debug"]];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment