I am using version 4 of this player and want to be able to interact with it as it iterates through each piece of media in the playlist. When a playlist is loaded into the player with XML, I want to get the ID from the media that's currently playing then dynamically show the related info to the user.
There is not much documentation on this version and my JavaScript skills are not that great.
Is what I want to do even possible with this version of JW Player? If it is, can someone either point me to an example that would incorporate this functionality or show me how this can be accomplished?
Related
So I am using video.js as my video player on my website, but was curious if there was a way (either using video.js or another video player) to be able to sync a video between all devices on the website?
For example, if Person A, Person B and Person C is viewing this video on my website, it would sync their video up so they are at the same time, and if either of them pauses then all three people see their video pause? A lot like Netflix Party / Youtube Party for videos. I am quite new to JS
It's possible to set and read the current time of a video in JavaScript with HTMLMediaElement.currentTime. You can also play/pause and check if its playing with either the paused attribute or the pause/play events.
You will need some form of backend to keep track of when all of this happens and to relay the appropriate time/events to everyone watching which is outside the scope of basic DOM JS (though there are JS based backends if that's your thing).
You'll probably need some form of live two-way connection like a websocket.
As I said in my title, I was wondering how I could add a cast button (For chromecast.) to a javascript based video player. Note, this player is a web player and integrated on this site: twist.moe
You can find the code for the player here, https://twist.moe/public/js/video.js But more over, I'm just wondering if its even possible to integrate the cast button into a javascript based player.
*Situation is -*I have to design a webpage that works on both desktop and on mobile devices, that plays an embeded youtube video (not autostarted) which then i can use interact with the video to get the play state etc (using this to count the total time watched, excluding pause/buffer/stop time)
I've managed to build the website using both the IFrame API and Javascript API from Youtube.
*However the problem is-*With Javascript API, the player on the desktop works and the view gets counted too but it doesnt work when i view it on a mobile device. The place where it should show the video (the div tag) doesnt react.
With the IFrame API, everything works in terms of functionality but when i press play on the video, the views do not get counted - accessed from both desktop and mobile. I've tested the viewcount several times, with different IP etc but while javascript API web gets counted instantly, IFrame API web is still not getting counted..
Does anyone have any suggestion to this problem?
Just to remind you, the crucial aspect of the webpage that i need are:
Embeded Youtube player
Being able to interact with the player (e.g. getState() or getDuration())
Website fully functional with mobile access
Valid view count
Thank you all in advance!! :)
Are you sure that the views are really being counted via the javascript api? I have always read that view counts only are considered valid when initiated using the actual YT play button. Meaning you can't initiate play via any API call and have the view count.
Here is a a somewhat dated blog post from Google/Youtube team explaining - https://groups.google.com/forum/#!msg/youtube-api-gdata/7SsbvOJMWL0/rBCBqnFaxRgJ
I'm trying to find something that says this has changed but so far no luck.
** EDIT **
So I went back to the iFrame and Javascript API pages and if you do a search for 'view count' the first piece of content you'll find is a line stating --
"Note: A playback only counts toward a video's official view count if it is initiated via a native play button in the player."
Re-reading your post I'm not sure if you are using the API's to play the video or just to get data from its current state. If you are using it to actually initiate play then the view counts are not actually being counted. If you are seeing something different I'd love to see and learn from it.
This is an interesting and weird problem, and I'm really not sure what's going on here. Maybe someone can offer me some insight. I have a simple form with a list of songs from both youtube and soundcloud. When the user clicks on one of the links(songs), it sends an ajax call to a script containing the essential ingredients of either a custom html5 youtube player (based on the Tubeplayer plugin), or a custom html5 soundcloud player (based on soundcloud's custom sc-player plugin).
The ajax calls work great. When the user clicks a track in the list, the appropriate plugin pops into the specified div and begins to play the song or video. There is a really wierd issue I'm having however. When I go from a youtube video to a soundcloud song, it works great. The youtube plugin is completely replaced by the soundcloud plugin. Playback on youtube stops and playback on soundcloud begins. But when a soundcloud song is playing and I click a youtube track in the list, the youtube plugin shows up and begins to play, but the soundcloud track continues to play also, even though the content in the div has been completely replaced with the youtube plugin via ajax.
I even tried taking the calls to the soundcloud plugin's js files and putting them into the script that the ajax calls to, so that even they would be replaced when the youtube plugin is called, but I'm still having the issue. Any idea as to what might be going on here? I'm really not very knowledgeable about jquery. Thanks in advance!!
I have a Flash player that I created with Moyea PlayerBox and I am trying to figure out how to find out when the video is done playing. I want to create a playlist kind of like ESPN does where you can do a check box for continuous play and if it is checked I want it to keep playing if not I want the user to be able to decide where on the playlist to play.
If you're willing to use an external library, it looks like JW Player supports a MediaEvent.JWPLAYER_MEDIA_COMPLETE event for this.