Hey,
The OSM Player works great! But, it only works when it's the only OSM player on the page. I'm attempting to display 5 separate players on any given page (five teasers from each node [with a custom playlist defined through a view...see: http://www.mediafront.org/documentation/drupalmediafront-osm-cms-integra... ]). It definitely does not like multiple players, even 2.
Has anyone had success displaying multiple players? In Drupal chat, I spoke with someone who knew someone that achieved this through views and adding a custom PHP field, but I am unable to duplicate this or able to contact the person (this was the extent of his knowledge regarding the solution).
This is literally the LAST bit of functionality I need to employ for my site, so any solutions or guidance would be awesome!!!
Thanks
| Comment | File | Size | Author |
|---|---|---|---|
| #21 | sample_video.zip | 5.82 KB | pixelsweatshop |
| #17 | FirefoxScreenSnapz001.jpg | 21.76 KB | BillMounce |
| #17 | FirefoxScreenSnapz002.jpg | 13.69 KB | BillMounce |
Comments
Comment #1
sp3boy commentedI've just started evaluating this module and quickly hit this issue. Some delving into the code suggests that it might be possible to override the theme preprocess in your own theme without changing any module code, however as I'm working on a test install with no custom themes and the changes are very small, here's a suggestion of how to do that, expressed as a couple of changes to the default preprocess function in the osmplayer.module file (in the modules/mediafront/players/osmplayer directory).
The change is to add the two lines with "// !!" comments. This effectively undermines the caching of player objects which as far as I can see was being done on a one-per-preset basis.
Note: I have only briefly tested this with a couple of nodes and a very simple preset with no playlist. This change may well break the playlist functionality for all I know but I thought I'd offer it for comment anyway.
Comment #2
sp3boy commentedLatest observation: if there is more than one player on the page and one of them is set to fullscreen-within-browser, some of the controls from another player may still be visible on top of it, presumably due to common z-ordering.
Comment #3
enjoylife commentedThis has been fixed in the 2.x. branch. You can find out more by watching this video: http://www.youtube.com/watch?v=ZZ3z0ko-uRU.
Comment #4
BarisW commentedThanks so much for sharing this piece of code sp3boy. I'm using the 2.x branch but this is definitely NOT fixed. Or at least, not in the D7 version. Moving back to needs work.
Comment #5
drakythe commentedBarisW
Would you mind explaining your problem, possibly with screenshots? I've seen multiple players work on a single page before, so I was under the impression this was fixed as well, so some details would be helpful so that we can either spot the problem in the configuration of the module, or Travis can find the code that is bugging out.
Comment #6
BarisW commentedIn my setup, I don't use a specific content type 'video'. I have a content type 'page' with an unlimited file field (using the Media library) that can contain youtube vids or mp3 files. I've created a view that shows all media files belonging to a specific node as a block in the sidebar (related media). In this view, I've chosen Rendered Entity and a custom view mode (side bar).
For the file display settings, I've selected Mediafront as display. This works when I have 1 file. However, when I have several files on one node, all get the same HTML ID. This not only creates invalid HTML, but also makes the players stop working. The code above fixes my issue.
As I'm on a vacation now making screenshots is a bit hard, but I think the above steps will help you reproduce the issue.
Comment #7
gtothab commentedI'm having the same problem. Got a view with a grid of videos. Only the first video shows up.
Comment #8
antoinetooley commentedI would really appreciate any help with this. Interested in trying the code above but can't even find a template_preprocess function in my osmplayer.module file. Has anybody actually managed to get this working in drupal 7?
Im still a drupal newbie so im sorry if I am a little slow working things out.
Thanks in advance.
Antoine
Comment #9
antoinetooley commentedi have tried this now on a fresh install and with version 2.0-rc3 aswell as the dev version and I just cant get more than one player to load and play on the same node. Can't see what I am doing wrong and you show this working in your tutorial introduction video. Is this a bug? or is there something fundamental I am missing?
Sorry to bother just really eager to get this done.
Thanks again.
Comment #10
pixelsweatshop commentedI can confirm that I am having the same issue. You can see an example on one of my client sites.
There are two videos "Featured" and "Testimonial". Depending on which browser you use, One or the other can be played, but not both. However they can be played when they are alone on a node without issue
*edit: urls removed for privacy reasons now that the issue is resolved*
Comment #11
travist commentedThis is probably a bug that should be investigated. The thing to check for here is if there are any javascript errors on the page that this is happening. If so, that could point to what is causing this issue to happen.
Comment #12
antoinetooley commentedOK, so I have had a look with firebug in firefox and it appears I am getting two errors when trying to play multiple videos in a grid format.
This is the first:
TypeError: this.player[a] is not a function
...me(function(b){return function(c){c+=parseFloat(a);c=0>c?0:c;b.setVolume(1
osmplayer.compressed.js?v=0.1 (line 106)
And the second:
Error: Permission denied to access property 'toString'
(this one does not appear to give me anymore information than that?)
I am still learning atm but let me know if I can do anything more to help.
Regards
Antoine
Comment #13
antoinetooley commented(sorry that didnt write my full message!!)
First error:
TypeError: this.player[a] is not a function
...me(function(b){return function(c){c+=parseFloat(a);c=0>c?0:c;b.setVolume(1
osmplayer.compressed.js?v=0.1 (line 106)
Second error:
Error: Permission denied to access property 'toString'
(does not appear to give me anymore information than this?)
Sorry I am still learning all of this but I hope this might help and please let me know if I can do anything.
Thanks again
Antoine
Comment #14
pixelsweatshop commentedI am coming back to this issue again. It appears that turning on drupal's cache/js aggregation is the culprit. The videos work fine when working on my dev site (hence I didn't notice it until I went live).
Comment #15
travist commentedOk thanks. Will investigate this further with caching turned on.
Comment #16
travist commentedI just tested multiple players on the same page w/ JS and CSS aggregation and it is working on my end. Can you please verify that there are not any JavaScript errors on the same page? It is very common for a poorly written javascript library to completely break when aggregation is turned on. All the mediafront js libs are pre-aggregated and compressed, so I don't think the errors would come from the mediafront libraries, but I would like to know if there is maybe another library causing the media players to stop working.
Comment #17
BillMounce commentedI can confirm that this is still an issue. I have two presets, one video and one audio. Both are text fields drawing from a CDN. When both are showing on a page, the second audio player is truncated. When the first (video) does not have a value, the second (audio) displays fine. See attached. Is there anything else I can tell you to help with this?
You can see it here: http://fortherestofus.org/content/sample-mediafront
Comment #18
antoinetooley commentedif its any help, I can get both players playing at once but one of them won't automatically start playing anymore and the same one won't play through the playlist either it gets stuck after the first video.
you had this working perfectly just after chirstmas. really enjoying this module and thanks for all the top work!
Comment #19
drakythe commentedBillMounce (I actually used that Greek book in college) I took a look at your page and firebugged it. I can't get the second media player to play either, though it appears that the problem might be it isn't pulling in the media properly, as it is linked to #. I don't know if that could be the cause of the problem, but it might be worth looking into.
Also, how exactly are you getting the content to the players? From the html structure it doesn't look like Views. Is it a single node and you are just rendering the fields as Mediafront widgets? If this is the case, one thing to try might be to go the Views route.
Comment #20
travist commentedBillMounce,
Will you try setting the templates to default template and see if they work with that template?
Comment #21
pixelsweatshop commentedI have been able to replicate this on a clean install. I have setup a quick feature to demonstrate this is.
1. Download and install the attached feature (including dependencies) http://drupal.org/files/sample_video.zip
2. Go to add content > sample video
3. Add at one with URL http://www.youtube.com/watch?v=i-DYHEuRCBA
4. Go to add content > sample video (again)
5. Add a second video with URL http://www.youtube.com/watch?v=UFS0tUJSMbQ
6. Go to /sample-video-view
7. See that the first video doesn't load and the second one works just fine.
Error console I see
Security Error: Content at http://www.youtube.com/ may not load data from http://sandbox.localhost/sample-video-view.Error: Error: Permission denied to access property 'toString'Hope this helps Travis.
Comment #22
travist commentednicoz,
First of all.... HUGE help to have a feature module to help me reproduce, so thank you!
I believe that I found the issue. just fixed this and have committed it to the latest DEV version.
http://drupalcode.org/project/mediafront.git/commitdiff/3024f1e
Please let me know if this doesn't work for you.... Thanks again,
Travis.
Comment #23
pixelsweatshop commentedYup. That did it. Thanks Travis. Can others confirm that running the latest dev resolves your issue, so we can close this. :)
Comment #24
antoinetooley commentedworks perfectly again. thanks!
Comment #26
antoinetooley commentedsorry to reopen this but autoplay for both players doesn't seem to work anymore (1 will autoplay the other will freeze). I can make it start playing by selecting any video which isn't the first one in the playlist but then once it gets to the end of the video most of the time it won't automatically load the next video. This seems to be happening since the latest update. cheers