Skip to content

Instantly share code, notes, and snippets.

View steffentchr's full-sized avatar

Steffen Fagerström Christensen steffentchr

View GitHub Profile
@steffentchr
steffentchr / fullscreen-button.js
Last active October 9, 2015 22:04
Fullscreen mode for 23 Video players, done with `window.open()`
/*
MODULE: FULLSCREEN BUTTON
Handle full screen button and shortcut.
Fires:
- player:fullscreenchange
Answers properties:
- supportsFullscreen [get]
- fullscreen [get/set]
@steffentchr
steffentchr / UpgradeToIframe.as
Last active December 15, 2015 23:22
Flex ActionScript application that replaces the loaded Flash object with an iframe pointing to the same location with the same parameters.
package {
import flash.display.LoaderInfo;
import flash.display.Sprite;
import flash.external.ExternalInterface;
import flash.utils.*;
[SWF(width="100%", height="100%")]
public class UpgradeToIframe extends Sprite {
private var interval:uint;
private function getIframeHtml():String {
@steffentchr
steffentchr / google-analytics.js
Created February 2, 2016 12:45
Google Analytics tracking module
/*
INTEGRATION: GOOGLE ANALYTICS
*/
Player.provide('integration-google-analytics',
{
googleAnalyticsAccount:'',
googleAnalyticsTrackPlayerPageview:0
},
function(Player,$,opts){
<?php
require_once('visualvideo.php');
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Content-Type: application/javascript");
function getProtectedToken($objectType, $objectId) {
// Fix: The result of this method should be cached and reused with memcached or similar
// Fix: The client should be loaded as a global outside of the function
$client = new VisualVideo('http://mydomain.23video.com',
$consumerKey,
<?php
require_once('visualvideo.php');
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Content-Type: application/javascript");
function getSessionToken($returnUrl, $name, $email) {
// Fix: The client should be loaded as a global outside of the function
// Note: This required use of privileged credentials with the API
$client = new VisualVideo('http://mydomain.23video.com',
$consumerKey,
@steffentchr
steffentchr / session-signing.js
Last active February 14, 2018 10:27
Session signing on TwentyThree with Node, request and oauth-1.0a
const request = require('request');
const crypto = require('crypto');
const OAuth = require('oauth-1.0a');
const domain = '<domain>';
const key = '<consumer_key>';
const secret = '<consumer_secret>';
const access_token = '<access_token>';
const access_secret = '<access_token_secret>';
const token = {
var fs = require('fs');
var Visualplatform = require('node-23video');
var FormData = require('form-data');
var uploadFileName = "/something/else.mp4";
var credentials = {
domain: "your.comain.com",
consumer_key: "89067856-abc...",
consumer_secret: "JtDohv...",
access_token: "12345-xyz...",
access_token_secret: "4dIZMs...",
@steffentchr
steffentchr / frontend-assignment-autocomplete.md
Created December 23, 2019 22:29
Frontend Assignment 3: Autocomplete input

Autocomplete input

full input

Implement the input above in React and CSS.

  1. Users should be able to search by typing into the search field. Search requests should be sent once every 300ms seconds while the user is typing.
  2. When a new character is entered old requests should be discarded.
  3. The search returns objects of two types: photos (videos) and live events.
  4. Search results should be displayed in a container below the input grouped by their type.