Skip to content

Commit

Permalink
flash audio workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
frankyghost committed May 13, 2014
1 parent 84e0b44 commit 4500602
Show file tree
Hide file tree
Showing 8 changed files with 325 additions and 89 deletions.
9 changes: 6 additions & 3 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,14 @@ module.exports = function (grunt) {
"src/controller/projekktor.messages.js",
"src/models/player.js",
"src/models/player.NA.js",
// {flag: "jwflash", src: "src/models/player.video.jwflash.js", alt: "src/models/player.audio.video.osmf.js" },
{flag: "jarisflash", src: "src/models/player.audio.video.flash.js", alt: "src/models/player.audio.video.osmf.js" },
{flag: "jarisaudioflash", src: "src/models/player.audio.flash.js"},
"src/models/player.audio.video.js",
"src/models/player.audio.video.hls.js",
"src/models/player.audio.video.vlc.js",
"src/models/player.playlist.js",
"src/models/player.image.html.js",
// {flag: "jwflash", src: "src/models/player.video.jwflash.js", alt: "src/models/player.audio.video.osmf.js" },
{flag: "jarisflash", src: "src/models/player.audio.video.flash.js", alt: "src/models/player.audio.video.osmf.js" },
// {flag: "osmf", src: "src/models/player.audio.video.osmf.js"},
{flag: "youtube", src: "src/models/player.youtube.js" },
"src/plugins/projekktor.display.js",
Expand Down Expand Up @@ -107,7 +108,7 @@ module.exports = function (grunt) {
all: {
files: filesPreUglify,
options: {
banner: "/*! Projekktor v<%= pkg.version %> | " + "http://www.projekktor.com | " + "Copyright 2010-2014 Sascha Kluger, Spinning Airwhale Media, http://www.spinningairwhale.com | " + "GNU General Public License - http://www.projekktor.com/license/\n" + "*/"
banner: "/*! Projekktor v" + version + " | " + "http://www.projekktor.com | " + "Copyright 2010-2014 Sascha Kluger, Spinning Airwhale Media, http://www.spinningairwhale.com | " + "GNU General Public License - http://www.projekktor.com/license/\n" + "*/"
}
}
},
Expand Down Expand Up @@ -297,12 +298,14 @@ module.exports = function (grunt) {
if (filepath.ver===true) {
var versionpath = pluginspath + "/" + filepath.src;
var dirs = grunt.file.expand({filter: 'isDirectory'}, [versionpath + "/*"]);

dirs.sort(
function versionSort($a, $b) {
return -1 * version_compare($a, $b);
}
)
filepath.src = dirs[0] + "/projekktor." + filepath.src + ".js";
grunt.log.writeln(filepath.src);
}
// check for user plugins
var user = filepath.user;
Expand Down
6 changes: 3 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -317,14 +317,14 @@
}
]


alert("hier")
var player = projekktor('.projekktor', {
// ratio: 16/9,
width: 760,
autoplay: true,
height: 426,
cookiePath: '/projekktor/',

// iframe: true,
// height: false,
imageScaling: "fixed",
// debug: true,
Expand Down Expand Up @@ -426,7 +426,7 @@


}, function(player) {
console.log("on ready")
console.log("on ready", player.getId())
return;
player.addListener('key', function() {console.log("intro.inc.html", arguments);})
// player.setFullscreen(true);
Expand Down
58 changes: 29 additions & 29 deletions src/controller/projekktor.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ projekktor = $p = function() {
tm = ref._testMediaSupport();

$.each(pltfrm, function(nothing, plt) {
$.each($.extend(tm[st], tm['*'] || []) || [], function(thisPlatform, val) {
$.each($.extend(tm[st], tm['*'] || []) || [], function(thisPlatform, val) {
if (plt!=null) {
if (thisPlatform!=plt) {
return true;
Expand Down Expand Up @@ -297,11 +297,11 @@ projekktor = $p = function() {
$.each(platforms, function(_na, platform) {
var k = 0,
streamType = 'http';

for (var j in data.file) {
if (data.file.hasOwnProperty(j)) {
if (j==='config') continue;
streamType = data.file[j].streamType || ref.getConfig('streamType') || 'http';
if (j==='config') continue;
streamType = data.file[j].streamType || data.config.streamType || 'http';

if ( ref._canPlay($p.mmap[mmapIndex].type, platform, streamType) ) {
k++;
Expand All @@ -324,7 +324,7 @@ projekktor = $p = function() {
extTypes[$p.mmap[mmapIndex].ext] = [];
}
extTypes[$p.mmap[mmapIndex].ext].push( $p.mmap[mmapIndex] );

if ($p.mmap[mmapIndex].streamType===null || $p.mmap[mmapIndex].streamType=='*' || $.inArray(streamType || [], $p.mmap[mmapIndex].streamType || '')>-1) {

if (!typesModels[$p.mmap[mmapIndex].type]) {
Expand Down Expand Up @@ -1028,7 +1028,7 @@ projekktor = $p = function() {
win = $(window);
target = this.getDC();
}

// prepare target:
target.data('fsdata', {
scrollTop: win.scrollTop() || 0,
Expand All @@ -1041,17 +1041,7 @@ projekktor = $p = function() {
bodyOverflowY: $(win[0].document.body).css('overflow-y'), // prevent IE7 crash
iframeWidth: target.attr('width') || 0,
iframeHeight: target.attr('height') || 0
}).css({
position: 'absolute',
display: 'block',
top: 0,
left: 0,
width: '100%',
height: '100%',
zIndex: 99999,
margin: 0,
padding: 0
});
}).addClass('fullviewport').removeAttr( 'style' );

// prepare parent window
win.scrollTop(0).scrollLeft(0);
Expand Down Expand Up @@ -1094,6 +1084,7 @@ projekktor = $p = function() {
}
target
.attr('style', (fsData.targetStyle==null) ? '' : fsData.targetStyle )
.removeClass('fullviewport')
.data('fsdata', null);
}
};
Expand Down Expand Up @@ -1628,7 +1619,7 @@ projekktor = $p = function() {
if (fullScreenApi.supportsFullScreen=='viewport' || (fullScreenApi.supportsFullScreen=='dom' && this.getConfig('forceFullViewport'))) {
return fullScreenApi;
}

// MEDIA ONLY:
// the browser supports true fullscreen for the media element only - this is semi cool
if (fullScreenApi.supportsFullScreen=='mediaonly') {
Expand Down Expand Up @@ -1752,6 +1743,7 @@ projekktor = $p = function() {
};

this.getCssPrefix = this.getNS = function() {

return this.config._cssClassPrefix || this.config._ns || 'pp';
};

Expand Down Expand Up @@ -1940,9 +1932,12 @@ projekktor = $p = function() {
this._detachplayerModel();

// reset player class
var wasFullscreen = this.getDC().hasClass('fullscreen');
var wasFullscreen = this.getDC().hasClass('fullscreen'),
wasFullViewport = this.getDC().hasClass('fullviewport');

this.getDC().attr('class', this.env.className)
if (wasFullscreen) this.getDC().addClass('fullscreen');
if (wasFullViewport) this.getDC().addClass('fullviewport');

This comment has been minimized.

Copy link
@rwlodkowski

rwlodkowski Jun 5, 2014

Collaborator

@frankyghost some changes in this commit causing lack of video in fullscreen mode.


// create player instance
var newModel = newItem.mediaModel.toUpperCase();
Expand Down Expand Up @@ -2240,7 +2235,9 @@ projekktor = $p = function() {
if (h) target.css({height: h + "px" });
}

try {this.playerModel.applyCommand('resize', {width: w, height: h}); } catch(e) {}
try {this.playerModel.applyCommand('resize', {width: w, height: h}); } catch(e) {}

return this;
};

this.setLoop = function(value) {
Expand Down Expand Up @@ -3024,25 +3021,27 @@ projekktor = $p = function() {
for (var i=0; i < $p.mmap.length; i++ ) {
if ($p.mmap.hasOwnProperty(i)) {
platforms = (typeof $p.mmap[i]['platform']=='object') ? $p.mmap[i]['platform'] : [ $p.mmap[i]['platform'] ];

$.each(platforms, function(_na, platform) {

if (platform==null)
return true;

streamType = $p.mmap[i]['streamType'] || ['http'];

$.each(streamType, function(key, st) {

if (result[st]==null)
result[st] = {};

if (result[st][platform]==null)
if (result[st][platform]==null) {
result[st][platform] = [];

}

// avoid dupes
if ( $.inArray($p.mmap[i]['type'], result[st][platform] )>-1 )
return true;
if ( $.inArray($p.mmap[i]['type'], result[st][platform] )>-1 ) {
// return true;
}


var reqPlatformVersion = ($p.models[ $p.mmap[i]['model'].toUpperCase() ].prototype[(platform.toLowerCase()) + 'Version'] || "1").toString();
Expand All @@ -3051,7 +3050,7 @@ projekktor = $p = function() {
try {
if ( $p.utils.versionCompare($p.platforms[platform.toUpperCase()]($p.mmap[i]['type']), reqPlatformVersion) ) {
// check if platform is enabled in config
if (ref.getConfig('enable'+platform.toUpperCase()+'Platform')!=false && $.inArray(platform.toLowerCase(), ref.getConfig('platforms'))>-1) {
if (ref.getConfig('enable'+platform.toUpperCase()+'Platform')!=false && $.inArray(platform.toLowerCase(), ref.getConfig('platforms'))>-1) {
result[st][platform].push($p.mmap[i]['type']);
if ($.inArray(platform.toUpperCase(), resultPlatforms)==-1) {
resultPlatforms.push(platform.toUpperCase());
Expand All @@ -3070,6 +3069,7 @@ projekktor = $p = function() {
})
}
}

$p._compTableCache = result;
$p._platformTableCache = resultPlatforms;

Expand Down Expand Up @@ -3315,7 +3315,7 @@ $p.models = {};
$p.newModel = function(obj, ext) {
if (typeof obj!='object') return false;
if (!obj.modelId) return false;

var result = false,
extend = ($p.models[ext] && ext!=undefined) ? $p.models[ext].prototype : {};

Expand Down
1 change: 1 addition & 0 deletions src/controller/projekktor.messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ projekktorMessages = {
"vlc": "VLC Plugin",
"auto": "automatic",
"quality": "quality",
"hd": "hd",
"high": "high",
"medium": "medium",
"low": "low",
Expand Down
Loading

0 comments on commit 4500602

Please sign in to comment.