Skip to content

Instantly share code, notes, and snippets.

@dmlap
dmlap / gist:5629805
Created May 22, 2013 18:32
Log out the value of the `src` attribute of a video element.
<!doctype html>
<html>
<head>
<title></title>
</head>
<body>
<video src="http://brightcove.vo.llnwd.net/e1/uds/pd/507017973001/507017973001_1247361339001_shark-1080p.mp4?playerId=558043668001&lineupId=&affiliateId=&pubId=507017973001&videoId=1247311399001"></video>
<script>
var video = document.querySelector('video');
console.log(video.src); // logs the video URL
@dmlap
dmlap / gist:3918603
Created October 19, 2012 14:48
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. */