How to display the big play button in the Azure media player? - azure-media-services

I'm new to the Azure media player.
I would like for the big play button to appear whenever the video is paused. I can see the element in the html, just not sure how to make this happen.
Thanks!

I agree with #vince in the answer, But the Big play Button wont go away when we want to play the paused video
so here you should do the following
myPlayer = amp(id, playerOptions, function() {
console.log('Good to go!');
this.addEventListener('pause', function() {
jQuery(".vjs-big-play-button").show();
});
this.addEventListerner('play', function(){
jQuery(".vjs-big-play-button").hide();
});
});

Add this code on your pause event.
$(".vjs-big-play-button").show();
Let me know if it works.

Related

Soundcloud API play event fired but not counted

I'm using a standard Soundcloud widget to run an embed song playback in our ads unit:
var scWidget = SC.Widget(scPlayer);
var songClicked = false;
scWidget.bind(SC.Widget.Events.READY, function() {
scWidget.bind(SC.Widget.Events.PLAY, function() {
if(!songClicked){
AdvertEvents.counter('Song Play');
songClicked = true; // make sure only count one play per load
}
});
});
Basically I'm adding a play count tracker to our system whenever the song starts playing using the Events.PLAY event. This should be equal to or fewer than the playcount on Soundcloud. But the 'Song Play' counter in my system appears to be higher than actual play count on Soundcloud (5k 'Song Play' events recorded in our system vs 3k playcounts on Soundcloud). What could be the problem here? Doesn't the PLAY event mean the song should be counted as one play on Soundcloud? Thanks a lot for your help.

Screen lock/unlock detection in Ionic App

My question, is there a way for a ionic app to detect whether the device screen is locked/unlocked? I do know the app can detect when it becomes 'paused' and is running in the background but this is not what I mean. The reason for this is I want to make a geolocation function that only runs while the device screen is unlocked. Thanks
you can use ionic events pause resume see this snippet
.run(function($ionicPlatform) {
$ionicPlatform.on("resume", function() {
// do something update your interval
}
$ionicPlatform.on("pause", function() {
// do something here to store the timestamp
}
});

How to set poster image in JW player from flv file?

How can I set a poster image using particular video frame (flv)?
I don't have image file available, so I wonder if it's possible to set a poster image "in the fly" from the video source.
No, that's not possible with JW Player.
Edit: A little more explanation.... JW Player doesn't actually "play" or "process" the video in any way. It's just a steering and styling script - it feeds the video to the browser's <video> tag if the browser can handle it, or to the Flash plugin. The player provides its own control bar, advertising capabilities, and so on, but when it comes to the video file itself, the player isn't touching it. So, there's no way to do things like extracting certain frames. The player isn't ffmpeg.
Here is a little bit of a hack you can use:
<div id="myElement"></div>
<script>
jwplayer("myElement").setup({
file: "/uploads/myVideo.mp4",
autostart: true,
mute: true,
controls: false
});
</script>
<script>
setTimeout(function() {
jwplayer().pause();
jwplayer().setMute(false);
jwplayer().setControls(true);
},3000);
</script>
What this does is basically autostarts the player, muted, with no controls, then after a second, pauses the player, and sets the controls and volume back. Essentially it is grabbing the first frame. Keep in mind this is a bit of a hack and isn't great for bandwidth.

How to stop video player on samsung Smart TV App without to show the black screen

Hi I'm developing Samsung app with SDK and emulator 4.5. I have a issue..The App shows by videoPlayer some videos loaded on server. My issue is: when the video play and I push button STOP, the video stops and the screen becomes black..I'd like to show the screen with the first frame of the video.
I have tried to do:
sf.service.VideoPlayer.setKeyHandler(tvKey.KEY_STOP, function()
{
if(Popup.getPopup()==Popup.getNPOPUP() && Similars.getOpenS()==false){
//videoPlayer.enterVideo(videoPlayer.url,videoPlayer.title,videoPlayer.from,videoPlayer.axoid,videoPlayer.nid); //riparte l'esecuzione del video
sf.service.VideoPlayer.stop();
videoPlayer.play();//insert function play
sf.service.VideoPlayer.pause();// stop video
videoPlayer.setFullScreen();
sf.service.VideoPlayer.show();
sf.service.VideoPlayer.pause();//stefa
}
});
I have inserted:
videoPlayer.play();//insert function play
sf.service.VideoPlayer.pause();// stop video
The play works but the pausa command not work
How can I do? Have you got a solution?
Thanks
I have inserted below
sf.service.VideoPlayer.stop();
setTimeout(function(){sf.service.VideoPlayer.pause();},2000); //delay function called of 2000 millisecond
I resolved my issue.
if delay time is not enough, you can increase the time to get the finish request.

Play a video whose URL is not known in advance - without reload - without extra tab

I have lots of buttons on a web page. Depending on which one is clicked, I want to play a different video.
A large number of <video> elements doesn't seem to work particularly quickly or reliably.
So far, I have tried to:
Create and play() the video element dynamically, after an image is clicked:
var video = document.createElement('video');
video.src = 'video.mp4';
document.body.appendChild(video.play);
video.play();
This works on iOS 4, but not on iOS 3.
Create the video element before, and just change the src.
Doesn't work either.
It seems like the video object must have already done "it's thing", before it can be played.
Use window.open() to open the video URL.
This will cause an annoying new tab to open, which will remain open after playback has completed.
Set window.location
This will cause the current page to be reloaded after playback has completed, which I'm trying to avoid.
Any more ideas?