Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTML5 Video player doest not show markers tip on live server. Its working fine on localhost. #78

Open
fahedusmanrana opened this issue Dec 5, 2017 · 3 comments

Comments

@fahedusmanrana
Copy link

fahedusmanrana commented Dec 5, 2017

I have created a script for interactive video and I got some requirements to show markers in the process bar of video. I worked on that and it works perfectly on localhost but when I put it live, only markers are showing. The text with those markers is not showing. I have searched everywhere on google and lot on videojs guides but I am not able to fix it. Below is my code for creating markers:

<video width="100%" controls id="sgm_2" class="video-js vjs-default-skin" preload="auto">
						<source src="video.mp4" type="video/mp4">
						<source src="video.webm" type="video/webm">
					  	<p class="vjs-no-js">Your browser does not support HTML5 video.</p>
					</video>
var player = videojs('sgm_2');
			player.markers({
				markerTip:{
			        display: true,
			        text: function(marker) {
			        	return marker.text;
			        },
			        time: function(marker) {
				    	return marker.time;
				    }
			    }
			});
			player.markers.reset([
				{
			    	time: 10,
			    	text: "Caption 1"
			    },    
			    {
			    	time: 20,
			        text: "Caption 2"
			    },
			    {
			    	time: 30,
			        text: "Caption 3"
			    },
			    {
			    	time: 40,
			        text: "Caption 4"
			    }
			]);`

Can anyone please check what is the thing I am missing or what is wrong with this code? I have also used the funcltion of add instead of reset markers but no luck. I will appreciate any help.

Thank you.

@spchuang
Copy link
Owner

Hey, I"m happy to help.

Could you create a jsbin so I can debug it more closely online? Thanks

@karan101292
Copy link

karan101292 commented Mar 18, 2018

same here. markers are not showing after hosting. its working on localhost.

player = videojs('my-video');
player.on('ready', function(){
	$http.get('questions/markers.json').then(function(response){
		makeModalData(response.data);
		player.markers({
		    markers: response.data,
		    onMarkerReached: function (marker, index) {
		    	player.pause();
		    	openModal(marker.id);
		    }
		});
	},function(error){
		debugger;
	});
});

Markers are coming from server.

@spchuang
Copy link
Owner

@karan101292, can you help create an example jsbin so i can repro online and debug?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants