Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

got first test passing

  • Loading branch information...
commit fc46d95928d7c3163497b4b4f1ffc270f03166af 1 parent 1918aa5
@mdale authored
View
1  players/kaltura/popcorn.kaltura.html
@@ -216,6 +216,7 @@
<div id="video"></div>
<div id='buttons'>
+ <button onclick="document._video.requestFullScreen()">requestFullScreen()</button>
<button onclick="document._video.load()">load()</button>
<button onclick="document._video.play()">play()</button>
<button onclick="document._video.pause()">pause()</button><br>
View
9 players/kaltura/popcorn.kaltura.unit.html
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
- <title>Vimeo Player Unit Test Suite</title>
+ <title>Kaltura Player Unit Test Suite</title>
<link rel="stylesheet" href="../../test/qunit/qunit.css" type="text/css" media="screen">
<script src="../../test/qunit/qunit.js"></script>
<script src="../../test/jquery.js"></script>
@@ -13,8 +13,11 @@
<script src="../../popcorn.js"></script>
<script src="../../modules/player/popcorn.player.js"></script>
- <script src="popcorn.vimeo.unit.js"></script>
- <script src="popcorn.vimeo.js"></script>
+ <script src="popcorn.kaltura.unit.js"></script>
+ <script src="../../wrappers/common/popcorn._MediaElementProto.js"></script>
+ <script src="../../wrappers/kaltura/popcorn.HTMLKalturaVideoElement.js"></script>
+ <script src="popcorn.kaltura.js"></script>
+
<script src="../../test/inject.js"></script>
</head>
View
50 players/kaltura/popcorn.kaltura.unit.js
@@ -1,29 +1,9 @@
asyncTest( "Options Check", function() {
-
- expect( 7 );
- var varz = {
- title: 0,
- byline: 0,
- portrait:0,
- autoplay:1,
- loop:1,
- color: "FFAADD",
- fullscreen: 0
- },
- p2 = Popcorn.vimeo( "#player_1", "http://vimeo.com/11336811", varz );
+ expect( 1 );
+ var p2 = Popcorn.kaltura( "#player_1", "http://www.kaltura.com/index.php/kwidget/cache_st/1292436446/wid/_243342/uiconf_id/2877502/entry_id/0_uka1msg4" )
p2.listen( "loadeddata", function() {
- var flashvars = $( 'param[name="flashvars"]' ).attr( "value" );
-
- var splitvars = flashvars.split( "&" );
-
- for ( var i = 0, len = splitvars.length; i < len; i++ ) {
- var item = splitvars[ i ].split( "=" );
- if ( varz.hasOwnProperty( item[ 0 ] ) ) {
- equal( varz[ item[ 0 ] ], item[ 1 ], item[ 0 ] + " is the expected value" );
- }
- }
-
+ ok( true, "loadeddata fired ");
start();
});
@@ -31,7 +11,7 @@ asyncTest( "Options Check", function() {
asyncTest( "Update Timer", function() {
- var p2 = Popcorn.vimeo( "#player_1", "http://player.vimeo.com/video/11336811" ),
+ var p2 = Popcorn.kaltura( "#player_1", "http://www.kaltura.com/index.php/kwidget/cache_st/1292436446/wid/_243342/uiconf_id/2877502/entry_id/0_uka1msg4" ),
expects = 17,
count = 0,
execCount = 0,
@@ -226,7 +206,7 @@ asyncTest( "Update Timer", function() {
asyncTest( "Plugin Factory", function() {
- var popped = Popcorn.vimeo( "#player_1", "http://player.vimeo.com/video/11336811" ),
+ var popped = Popcorn.kaltura( "#player_1", "http://www.kaltura.com/index.php/kwidget/cache_st/1292436446/wid/_243342/uiconf_id/2877502/entry_id/0_uka1msg4" ),
methods = "load play pause currentTime mute volume roundTime exec removePlugin",
// 15*2+2+2. executor/complicator each do 15
@@ -342,7 +322,7 @@ asyncTest( "Plugin Factory", function() {
});
-asyncTest( "Popcorn vimeo Plugin Url and Duration Tests", function() {
+asyncTest( "Popcorn kaltura Plugin Url and Duration Tests", function() {
function plus() {
if ( ++count == expects ) {
popcorn.pause();
@@ -352,7 +332,7 @@ asyncTest( "Popcorn vimeo Plugin Url and Duration Tests", function() {
var count = 0,
expects = 3,
- popcorn = Popcorn.vimeo( "#player_1", "http://player.vimeo.com/video/11336811" );
+ popcorn = Popcorn.kaltura( "#player_1", "http://www.kaltura.com/index.php/kwidget/cache_st/1292436446/wid/_243342/uiconf_id/2877502/entry_id/0_uka1msg4" );
expect( expects );
@@ -372,16 +352,16 @@ asyncTest( "Popcorn vimeo Plugin Url and Duration Tests", function() {
popcorn.play();
});
-asyncTest( "Popcorn vimeo Plugin Url Regex Test", function() {
+asyncTest( "Popcorn kaltura Plugin Url Regex Test", function() {
var urlTests = [
{ name: "standard",
- url: "http://player.vimeo.com/video/11336811",
- expected: "http://player.vimeo.com/video/11336811"
+ url: "http://www.kaltura.com/index.php/kwidget/cache_st/1292436446/wid/_243342/uiconf_id/2877502/entry_id/0_uka1msg4",
+ expected: "http://www.kaltura.com/index.php/kwidget/cache_st/1292436446/wid/_243342/uiconf_id/2877502/entry_id/0_uka1msg4"
},
{ name: "short url",
- url: "http://vimeo.com/11336811",
- expected: "http://vimeo.com/11336811"
+ url: "http://www.kaltura.com/index.php/kwidget/cache_st/1292436446/wid/_243342/uiconf_id/2877502/entry_id/0_uka1msg4",
+ expected: "http://www.kaltura.com/index.php/kwidget/cache_st/1292436446/wid/_243342/uiconf_id/2877502/entry_id/0_uka1msg4"
}
];
@@ -393,7 +373,7 @@ asyncTest( "Popcorn vimeo Plugin Url Regex Test", function() {
Popcorn.forEach( urlTests, function( values, key ) {
var urlTest = urlTests[ key ],
- popcorn = Popcorn.vimeo( "#player_2", urlTest.url );
+ popcorn = Popcorn.kaltura( "#player_2", urlTest.url );
popcorn.listen( "loadeddata", function() {
@@ -410,7 +390,7 @@ asyncTest( "Popcorn vimeo Plugin Url Regex Test", function() {
});
});
-asyncTest( "Popcorn Vimeo Plugin offsetHeight && offsetWidth Test", function() {
+asyncTest( "Popcorn kaltura Plugin offsetHeight && offsetWidth Test", function() {
var popped,
elem,
@@ -424,7 +404,7 @@ asyncTest( "Popcorn Vimeo Plugin offsetHeight && offsetWidth Test", function() {
start();
}
}
- popped = Popcorn.vimeo( "#player_3", "http://player.vimeo.com/video/11336811" );
+ popped = Popcorn.kaltura( "#player_3", "http://www.kaltura.com/index.php/kwidget/cache_st/1292436446/wid/_243342/uiconf_id/2877502/entry_id/0_uka1msg4" );
popped.listen( "loadeddata", function() {
elem = document.querySelector( "div#player_3 object" );
View
31 wrappers/kaltura/popcorn.HTMLKalturaVideoElement.js
@@ -10,7 +10,7 @@
var EMPTY_STRING = '';
// Some default sizes:
- MIN_WIDTH = 300, MIN_HEIGHT = 200;
+ MIN_WIDTH = 240, MIN_HEIGHT = 180;
function HTMLKalturaVideoElement(id, options) {
var self = this, parent = typeof id === "string" ? Popcorn.dom.find(id)
@@ -65,7 +65,8 @@
*/
function setKalturaConfig(){
// By default lead with html5
- if( typeof options.leadWithHTML5 == 'undefined' || options.leadWithHTML5 === true ){
+ if( typeof self._options.leadWithHTML5 == 'undefined' || self._options.leadWithHTML5 === true ){
+ mw.setConfig( 'EmbedPlayer.NativeControls', true);
mw.setConfig( 'KalturaSupport.LeadWithHTML5', true);
}
}
@@ -90,12 +91,15 @@
// Load the kWidget library ( if not already set )
if (!window.kWidget) {
// replace in an embedIframeJs url if kWidgetUrl is not set
- var src = options.kWidgetUrl
- ||
- aSrc.replace(
- 'index.php\/kwidget\/cache_st\/[^\]*/wid/',
- 'p/').replace('uiconf_id\/',
- 'embedIframeJs/uiconf_id/');
+ var src = self._options.kWidgetUrl
+ ||
+ // 1.7 is not on production yet once it is; substitute in the regex
+ 'http://html5video.org/kaltura-player/mwEmbedLoader.php'
+ //aSrc.replace(
+ // /index.php\/kwidget\/cache_st\/[^/]*\/wid\/_([^/]*)\/(uiconf_id\/[^/]*)\/.*/,
+ // 'p/$1/sp/$100/$2/partner_id/$1').replace('uiconf_id\/',
+ // 'embedIframeJs/uiconf_id/');
+
Popcorn.getScript(
src,
@@ -117,7 +121,6 @@
}
// kWidget has been loaded set config
setKalturaConfig();
-
// Get embed settings:
var embedSettings = kWidget.getEmbedSettings(aSrc,
@@ -150,7 +153,9 @@
// setup listener events: ( if the player is HTML5 ) just directly map:
if( kdp.evaluate('{isHTML5}') ){
+
var vid =window.frames[ playerUID + '_ifp' ].document.getElementById( 'pid_' + playerUID );
+
["loadstart", "progress", "suspend", "abort", "error", "emptied",
"stalled", "loadedmetadata", "loadeddata", "canplay", "canplaythrough",
"waiting", "seeking", "seeked", "ended", "durationchange", "timeupdate",
@@ -181,6 +186,8 @@
// Once media is ready to be played trigger associated events
kdp.kBind('mediaReady', function() {
+ // if we have not already done so dispatch "loadeddata"
+ self.dispatchEvent( "loadeddata" );
playerReady = true;
// run any playerReadyCallbacks
while( playerReadyCallbacks.length ){
@@ -230,6 +237,12 @@
kdp.sendNotification('doPause');
}
}
+ self.requestFullScreen = function(){
+ if( kdp ){
+ var embedPlayer = window.frames[ playerUID + '_ifp' ].document.getElementById( playerUID );
+ embedPlayer.fullscreen();
+ }
+ }
// Setup a player callback for defining all the mapped properties:
addPlayerReadyCallback( function(){

0 comments on commit fc46d95

Please sign in to comment.
Something went wrong with that request. Please try again.