Skip to content

Instantly share code, notes, and snippets.

@jhorsman
jhorsman / play-pause-player.html
Created October 31, 2013 12:27
Play and pause a Media Manager player
<!DOCTYPE html>
<!--
Using
- HTML5 video player
- play event
- pause event
Try this script on http://jsfiddle.net/3MjZu/1/
-->
<html>
@jhorsman
jhorsman / note
Created October 31, 2013 12:27
Media Manager HTML5 video player info from /html/head/metadata
//from http://sdl-training.dist.sdlmedia.com/vms/distribution/?o=2981B015-A171-4C6A-BEC6-9C0BC80B9F4E
<meta content="Business_people.mp4" property="og:title">
<meta content="Business_people.mp4" property="og:description">
<meta content="video" property="og:type">
<meta content="http://sdl-training.dist.sdlmedia.com/vms/distribution/?o=2981B015-A171-4C6A-BEC6-9C0BC80B9F4E" property="og:url">
<meta content="http://sdl-training.dist.sdlmedia.com/scripts/cropper.asp?i=634965106911552910JZ_B.jpg&amp;p=thumbnail&amp;w=398&amp;h=224" property="og:image">
<meta content="https://sdl-training.dist.sdlmedia.com/scripts/cropper.asp?i=634965106911552910JZ_B.jpg&amp;p=thumbnail&amp;w=398&amp;h=224" property="og:image:secure_url">
<meta content="SDL Training powered by SDL| Media Manager" property="og:site_name">
@jhorsman
jhorsman / play-pause-player.html
Created October 31, 2013 12:29
Play/pause a SDL Media Manager video
// Example video: http://sdl-training.dist.sdlmedia.com/vms/distribution/?o=C0C21DD1-A520-4297-BECD-A672B98D8C35
// The video player is contained in <div id="asset01">
$("#asset01").trigger("play");
$("#asset01").trigger("pause");
@jhorsman
jhorsman / preload-example.html
Last active December 27, 2015 01:59
Pre-load stills for a SDL Media Manager video player. See http://jsfiddle.net/Jhorsman/nQ85f/
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<title>Dynamic SDL Media Manager video embed</title>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<link rel="stylesheet" type="text/css" href="stylesheet.css"/>
</head>
<body>
Player A
@jhorsman
jhorsman / press-any-key-to-continue.ps1
Created November 11, 2013 09:37
How to program a "Press any key to continue" in PowerShell
Write-Host "This is a test..."
Write-Host
Write-Host "Press any key to continue"
$void = $host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
@jhorsman
jhorsman / PublishPage.cs
Last active December 28, 2015 09:49
Publish a page using SDL Tridion Core Service. This example shows how to use the Core Service API without configuration file and using the BasicHTTP binding. There are other options too, like using the configuration file instead of in code configuration and using NetTcp instead of BasicHTTP.
using System;
using System.ServiceModel;
using Tridion.ContentManager.CoreService.Client;
using TridionCoreserviceSession;
...
// Make a Core Service connection
CoreServiceSession session = new CoreServiceSession( "localhost", "[username]" , "[password]");
@jhorsman
jhorsman / try-coreservice.ps1
Created November 22, 2013 14:01
Try out the SDL Tridion 2013 PowerShell module from http://code.google.com/p/tridion-powershell-modules/. Also see Tridion.stackexchange: http://tridion.stackexchange.com/q/3641/88
Set-TridionCoreServiceHost my.cm.host
Get-TridionUser -Verbose
Get-TridionPublications | Select-Object Id, Title
@jhorsman
jhorsman / Tridion-Install-CoreService-Module.ps1
Last active December 29, 2015 10:39
Install the Tridion CoreService module. As documented in http://tridion.stackexchange.com/q/3641/88. This script is not stable at all.
$powershellModulePath = $env:UserProfile + "\Documents\WindowsPowerShell\Modules\Tridion-CoreService"
#todo test if path is in $env:PSModulePath http://msdn.microsoft.com/en-us/library/dd878350%28v=vs.85%29.aspx
$powershellClientPath = $powershellModulePath + "\Clients"
Write-Debug ("PowerShell module path: {0}" -f $powershellModulePath)
if(!(Test-Path $powershellModulePath))
{
$newModuleFolder = New-Item -path $powershellModulePath -type directory
Write-Debug ("Created new module directory {0}" -f $newModuleFolder.FullName)
}
if(!(Test-Path $powershellClientPath))
@jhorsman
jhorsman / Media Manager still URL.md
Last active October 28, 2016 09:00
SDL Media Manager video still image (used for thumbnail). Mind that this feature has to be enabled in the Media Manager configuration.
@jhorsman
jhorsman / Session cartridge
Created December 4, 2013 10:10
SDL Tridion Ambient Data Framework ADF claims. Claims are defined in the cartridge configuration file, usually this is in the cartridge JAR. #tridion #ADF
(all are set OnRequestStart)
taf:claim:ambientdata:sessioncartridge:session:sessionid
taf:claim:ambientdata:sessioncartridge:session:creationtimestamp
taf:claim:ambientdata:sessioncartridge:session:lifetime
taf:claim:ambientdata:sessioncartridge:refererdomain
taf:claim:ambientdata:sessioncartridge:useragent:browser
taf:claim:ambientdata:sessioncartridge:useragent:browser:version
taf:claim:ambientdata:sessioncartridge:useragent:isbot
taf:claim:ambientdata:sessioncartridge:useragent:os
taf:claim:ambientdata:sessioncartridge:useragent:os:version