ffissore / presentz.js

A js library to show synchronized video and slides presentations, powering presentz.org
http://presentz.org/
GNU Lesser General Public License v3.0
143 stars 20 forks source link

Html5 not working #32

Closed AlexObreja closed 6 years ago

AlexObreja commented 6 years ago

Hi, i'm trying to load html5 video selfhosted using the MediaElement Library but without success. Other libraries are working but only Html5 not. I think the problem it's where

playerOptions = { timerRate: 500, success: (function(_this) { return function(me) { _this.onPlayerLoaded(me); }; })(this) }; new MediaElementPlayer("#" + this.elementId, playerOptions);

Return function is not loading and i don't really know how to make it load.

Here my Json and JS:

``

AlexObreja commented 6 years ago

Found the issue. You need to change the line 416 without the hashtag from this Html5Video.prototype.changeVideo = function(videoData, wouldPlay1) { var $videoContainer, playerOptions; this.wouldPlay = wouldPlay1; $videoContainer = jQuery(this.videoContainer); $videoContainer.empty(); $videoContainer.append("<video id=\"" + this.elementId + "\" controls preload=\"none\" src=\"" + videoData.url + "\" width=\"100%\" height=\"100%\"></video>"); playerOptions = { timerRate: 500, success: (function(_this) { return function(me) { _this.onPlayerLoaded(me); }; })(this) }; new MediaElementPlayer("#" + this.elementId, playerOptions); };

to this:

Html5Video.prototype.changeVideo = function(videoData, wouldPlay1) { var $videoContainer, playerOptions; this.wouldPlay = wouldPlay1; $videoContainer = jQuery(this.videoContainer); $videoContainer.empty(); $videoContainer.append("<video id=\"" + this.elementId + "\" controls preload=\"none\" src=\"" + videoData.url + "\" width=\"100%\" height=\"100%\"></video>"); playerOptions = { timerRate: 500, success: (function(_this) { return function(me) { _this.onPlayerLoaded(me); }; })(this) }; new MediaElementPlayer(this.elementId, playerOptions); };

ffissore commented 6 years ago

Why did you close the issue? Was it invalid? If it was valid as I think it is, would you like to share your fix with a pull request?

AlexObreja commented 6 years ago

Hy Federico, because i fixed it. I wrote a comment for the fix but i didn't made a pull request. I can do it. The line i've edited was the 416 removing the hashtag. Give me a minute and i'll make the pull request

AlexObreja commented 6 years ago

By the way, very great job. I'll continue to improve the repository with my suggestions in future. I'm using it for a project sharing all the credits to the repo.