Skip to content

Commit

Permalink
DRM Update
Browse files Browse the repository at this point in the history
  • Loading branch information
tomjohnson916 committed Jul 14, 2014
1 parent 63a45ba commit 6677dfb
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 6 deletions.
12 changes: 9 additions & 3 deletions example.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,20 @@
<body>
<video id="vid1"
class="video-js vjs-default-skin"
height="360"
width="640"
height="540"
width="960"
poster="http://assets1.ignimgs.com/vid/thumbnails/user/2014/06/02/20823568_ultrasf4_060214_1280_grande.jpg"
controls>
<source
src="http://multiplatform-f.akamaihd.net/z/multi/companion/bourne_ultimatum/The Bourne Ultimatum - Trailer_,1000,1500,2500,4000,k.mp4.csmil/manifest.f4m?hdcore"
src="http://bcqaus-vh.akamaihd.net/z/1910141515001/201406/1910141515001_3638100632001_TC-build-297-95e1558c-4de4-4b1f-b2c1-a7a564da038eMPEG-4-AVC-AAC0040005021270-32187b1e8f64c3cf.mp4.f4m/manifest.f4m?hdcore"
type="application/adobe-f4m">
</video>
<script>
// Akamai SRC
// DRM - http://bcqaus-vh.akamaihd.net/z/1910141515001/201406/1910141515001_3638100632001_TC-build-297-95e1558c-4de4-4b1f-b2c1-a7a564da038eMPEG-4-AVC-AAC0040005021270-32187b1e8f64c3cf.mp4.f4m/manifest.f4m
//http://multiplatform-f.akamaihd.net/z/multi/companion/bourne_ultimatum/The Bourne Ultimatum - Trailer_,1000,1500,2500,4000,k.mp4.csmil/manifest.f4m?hdcore
//IGN SRC
//http://absassets.ign.com/z/assets.ign.com/videos/zencoder/,416/bbc9e960b4ccce9f7314f4f6c828cce8-110000,640/bbc9e960b4ccce9f7314f4f6c828cce8-1000000,960/bbc9e960b4ccce9f7314f4f6c828cce8-1500000,1280/bbc9e960b4ccce9f7314f4f6c828cce8-3000000,1920/bbc9e960b4ccce9f7314f4f6c828cce8-5000000,-1402129217-w.mp4.csmil/manifest.f4m?hdcore&b=200-
// Set Regular VideoJS SWF
videojs.options.flash.swf = 'node_modules/video.js/dist/video-js/video-js.swf';
// Set OSMF SWF
Expand Down
9 changes: 8 additions & 1 deletion src/as/VideoJSOSMF.as
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import flash.ui.ContextMenuItem;
import org.osmf.containers.MediaContainer;
import org.osmf.events.AudioEvent;
import org.osmf.events.BufferEvent;
import org.osmf.events.DRMEvent;
import org.osmf.events.DisplayObjectEvent;
import org.osmf.events.DynamicStreamEvent;
import org.osmf.events.LoadEvent;
Expand Down Expand Up @@ -175,6 +176,7 @@ public class VideoJSOSMF extends Sprite {
_mediaPlayer.addEventListener(DynamicStreamEvent.NUM_DYNAMIC_STREAMS_CHANGE, onDynamicStreamEvent);
_mediaPlayer.addEventListener(DynamicStreamEvent.SWITCHING_CHANGE, onDynamicStreamEvent);
_mediaPlayer.addEventListener(MediaErrorEvent.MEDIA_ERROR, onMediaErrorEvent);
_mediaPlayer.addEventListener(DRMEvent.DRM_STATE_CHANGE, onDRMEvent);
}

private function createMediaElement():void {
Expand All @@ -198,7 +200,7 @@ public class VideoJSOSMF extends Sprite {
private function createLayoutMetadata():void {
Console.log('Create LayoutMetadata');
_layoutMetadata = new LayoutMetadata();
_layoutMetadata.scaleMode = ScaleMode.STRETCH;
_layoutMetadata.scaleMode = ScaleMode.LETTERBOX;
_layoutMetadata.percentWidth = 100;
_layoutMetadata.percentHeight = 100;
_layoutMetadata.verticalAlign = VerticalAlign.MIDDLE;
Expand Down Expand Up @@ -355,6 +357,11 @@ public class VideoJSOSMF extends Sprite {
dispatchExternalErrorEvent(event.type, event.error);
}

private function onDRMEvent(event:DRMEvent):void {
Console.log('onDRMEvent', event.drmState);
Console.log(event.toString());
}

private function onLayoutTargetEvent(event:LayoutTargetEvent):void {
Console.log('onLayoutTargetEvent', event.toString());
}
Expand Down
2 changes: 1 addition & 1 deletion src/as/com/videojs/utils/Console.as
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import flash.external.ExternalInterface;
import flash.utils.describeType;

public final class Console {
private static const USE_CONSOLE:Boolean = false;
private static const USE_CONSOLE:Boolean = true;
private static const CONSOLE_REFERENCE:String = "OSMF_Tech";
/**
Call the JS console API
Expand Down
2 changes: 1 addition & 1 deletion src/js/videojs-osmf-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ videojs.Osmf.prototype.streamStatus = function() {
// If autoplay, go
if(player.options().autoplay) {
player.play();
} else {
} else if(player.options().preload) {
player.currentTime(0);
player.play();
player.pause();
Expand Down

0 comments on commit 6677dfb

Please sign in to comment.