Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am mister-ben on github.
  • I am misterben (https://keybase.io/misterben) on keybase.
  • I have a public key ASAM2JS8dWiWoQctIuWnnjZzMWSRgWqh-LZnrZ9eS25ljAo

To claim this, I am signing this object:

@mister-ben
mister-ben / index.html
Last active November 12, 2016 09:17
React
<div id="container"></div>
<script src="//cdnjs.cloudflare.com/ajax/libs/react/0.14.7/react-with-addons.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/react/0.14.7/react-dom.js"></script>
<script src="//players.brightcove.net/906043040001/default_default/index.js">
@mister-ben
mister-ben / 0_reuse_code.js
Last active August 29, 2015 14:24
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@mister-ben
mister-ben / index.html
Created May 6, 2015 10:57
JS Bin Subtle skin // source http://jsbin.com/bipiga
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="Subtle skin">
<meta charset="utf-8">
<title>JS Bin</title>
<link href='http://fonts.googleapis.com/css?family=Comfortaa:300' rel='stylesheet' type='text/css'>
<style id="jsbin-css">
/*Player size*/
.video-js {
@mister-ben
mister-ben / blockcontextmenu.js
Last active August 29, 2015 14:06
Brightcove Smart Player plugin to inhibit right-click menu within the player iframe. Prevents the user using 'save as'. This only affects the context menu - a determined user can still download an HTTP video.
/*
Inhibits the right-click menu within the smart player iframe
*/
(function() {
document.addEventListener('contextmenu',function(e){
e.preventDefault();
});
}());
<?php
// Brightcove sample for MRSS feed
// This is just a sample to get you started. You can customize further as your requirements
// grow.
// The following is a list of requirements and conditions in order for this podcast feed
// to function properly;
// 1) You must have a Pro or Enterprise level Video Cloud Account.
// 2) You will need to contact Brightcove Support to request an API READ Token with URL
// access, if you don't have one already.
@mister-ben
mister-ben / html5playerlogo.js
Created September 2, 2014 12:21
Player logo overlay for Video Cloud HTML5 player. Logo can only be displayed non-fullscreen.
(function() {
function onPlayerReady() {
var overlay = videoPlayer.overlay();
$(overlay).html('<img id="overlaylogo" src="http://cs1.brightcodes.net/ben/img/genericlogo.png" />').css({
position:"fixed",
height:"100%",
width:"100%"
});
$("#overlaylogo").css({
@mister-ben
mister-ben / exitfullscreen.js
Last active August 29, 2015 14:03
Plugin for Brightcove HTML player. Exits fullscreen on stop events.
/*
Exits from iOS fullscreen on stop / pause
*/
(function() {
function onPlayerReady() {
videoPlayer.addEventListener(brightcove.api.events.MediaEvent.STOP, function(event){
$("video")[0].webkitExitFullScreen();
@mister-ben
mister-ben / hide_dock.sh
Created May 30, 2014 14:00
Show / hide dock on OS X
#!/usr/bin/osascript
tell application "System Events" to set the autohide of the dock preferences to true
#!/usr/bin/env ruby
# Creates a video sitemap following this spec https://support.google.com/webmasters/answer/80472?hl=en
#
# This is a proof of concept that shows mapping Media API output to the sitemap fields. It produces a
# sitemap listing every video in a Video Cloud account, and the page URLs are all the same page with
# a varying bctid URL parameter. This would instruct a video player at that page to load that
# particular video. For production use you would probably take a different approach - e.g. for
# each URL you list in your regular sitemap you'd want to look up and add the details of the video
# that's published there.