Jump to content
Sign in to follow this  
hartmut

center a youtube movie window in web viewer

Recommended Posts

It is so nice to be able to get a movie into webviewer. The problem is you always have to scroll to get the movie centered. Is there any way to script this so we can find an exact location on a web page that has all their objects in the same places each time?

Thanks

Share this post


Link to post
Share on other sites

You mean no one in this place has an answer about centering a video from a web page in webviewer? Many must come across this problem. Is there no answer?

Share this post


Link to post
Share on other sites

http://fmforums.com/forum/showpost.php?post/214480/

i borrowed the file from this link and found that I can center the video from you tube but It doesn't play

try it and see. Maybe someone knows how to make this work.

Thanks

Dave

WebViewer_modified.zip

Share this post


Link to post
Share on other sites

HELLO

I have not had any responses to this post. I wonder why. I am writing this to see if anyone here interested in centering a youtube video within their webviewer could write a request to help us filemaker people use it in our databases the way web devs. use it on their web pages. They can give you an embed code for a web page. I think they might be able to do that for our webviewers. Maybe if we all write in to them it could happen.

editor@youtube.com

Share this post


Link to post
Share on other sites

Hello

Just me again. I found a javascript someone has developed. I am not sure it works with safari. I don't know how to enable another browser to work with webviewer. but this is at least a script ( I have no idea how to implement it) I found at :

http://userstyles.org/styles/1504

// ==UserScript==

// @name YouTube Video Only

// @namespace http://userstyles.org

// @description Removes everything except for the video and title on YouTube. Inspired by Youtube - Just the video please by pile0nades

// @author Stupid Head

// @homepage http://userstyles.org/styles/1504

// @include http://www.youtube.com/watch*

// @include http://youtube.com/watch*

// ==/UserScript==

var css = "@namespace url(http://www.w3.org/1999/xhtml); div:not(:first-child),td:not(:first-child),#logoTagDiv{display:none!important;} #baseDiv{width:auto!important;text-align:center!important;}";

if (typeof GM_addStyle != "undefined") {

GM_addStyle(css);

} else if (typeof addStyle != "undefined") {

addStyle(css);

} else {

var heads = document.getElementsByTagName("head");

if (heads.length > 0) {

var node = document.createElement("style");

node.type = "text/css";

node.innerHTML = css;

heads[0].appendChild(node);

}

}

Maybe someone can help me find a way to make this work.

Thanks

Dave

Share this post


Link to post
Share on other sites

Lol, I'll make it easy for you. See the attached. The method for embedding is pretty straight forward - just check out the source for the web viewer.

I've included a few vids for your entertainment :

youtube.zip

Share this post


Link to post
Share on other sites

Darn beaten to the draw! : I was just about to post a sample reference on embedding youtube.

Share this post


Link to post
Share on other sites

But how do you center the Video window? If you try to shrink the webviewer field to the same size as the youtube video window, it's off center.

Never thought to make a YouTube file....lol. But then again the last thing I need is everyone at work watching youtube videos. :

Share this post


Link to post
Share on other sites

Its not off center - there's a body margin and a the table has cellpadding and spacing that make it take up more room than it seems, make tbe webviewer bigger instead.

Anyway:

put that up the top and add a closing body tag down the bottom.

Edited by Guest

Share this post


Link to post
Share on other sites

I think that there may be a shortcut maybe?

Set the web viewer to:

"http://www.youtube.com/watch?v=" & WebViewer::VideoID

Where the VideoID field would store the Youtube ID. It seems to work fine. I tested with these three IDs.

AY9qcDCFeVI

E8uU8oSTo84

qqsG_Quyf-k

Share this post


Link to post
Share on other sites

Oh no, that does work, but if you want other html content around it...

Share this post


Link to post
Share on other sites

Ahh ok....Just had to come at it from the opposite direction.

Edit: Or not. :

Edited by Guest

Share this post


Link to post
Share on other sites

Though i suppose you could always just shove it in an iframe:

""

Share this post


Link to post
Share on other sites

Thanks everyone.

btw. they run all the time. to fix that I made a script to go to layout and back to browse and they stop playing. That is the way i was viewing them before. but now after these answers I don't need to do that. I am so excited about this.

I really appreciate the help.

Dave

Edited by Guest

Share this post


Link to post
Share on other sites

Hi Dave,

What do you mean when you say they "run all the time"?

Oh you mean if you start one playing and go to the next one the previous one is still playing... Yeh, that's weird. I wouldn't go into layout mode though, better to go to a different layout and come back.

(to anyone who's thinking I'm crazy, Set Web Viewer only works on the current record).

Edited by Guest

Share this post


Link to post
Share on other sites

Thanks for all the great help here on the forum.

One of the layouts in the database has a web viewer. As you hit the next record button a different web page will load based on a stored URL field. If any of the web pages displayed have sound or music, the sound continues to play after you hit the next record button and a different URL is displayed. Is there a way to stop the music and reset the viewer for each new record loaded?

Thanks,

Mike

Share this post


Link to post
Share on other sites

Hello,

Have you tried the "Reset" button from Action -> Reset (from the Web Viewer) option?

Share this post


Link to post
Share on other sites

That didn't work other than resetting the current page. The sound from the previous record's URL continues to play.

Share this post


Link to post
Share on other sites

Reset web viewer only works on the web viewer in the current record - As i suggested in an earlier post, create a script:

Goto Layout[ some other layout]

Goto Layout[original layout]

That should stop all web viewers.

Share this post


Link to post
Share on other sites

Thank you for this fantastic thread. This is really inspiring as as solution that I am looking for to get round IWP QT file limitations. ... But I am struggling to get this to work for a web server I have.

I have rearranged what I understand to be right for my purposes but FM says that there is a problem with "/" & I can't see why. The only real difference with the Youtube version & mine is that my URL is made up from a calc field PMW COMMERCIALS TALENT::File1_Calc . I know the calc field works, as I use it as a button to download file QT files. Naturally, what I want to to view them within FM & more importantly IWP.

Below is my version of the script. Can anyone see what I am doing wrong?

Many thanks

"data:text/html," &

"

"">

"" type="application/quicktime" wmode="transparent" width="425" height="350">

"

Share this post


Link to post
Share on other sites

You seem to be missing a few quotes. Try the following.


"data:text/html," &



"





















" 

Share this post


Link to post
Share on other sites

You have just solved one of my greatest FM mysteries. Thank you.

But ... Do you know why it does not work in IWP?

Edited by Guest

Share this post


Link to post
Share on other sites

I am a little stumped. I have tried loads browsers but the qt file does not show up in IWP. I have attached 2 pix that graphically show the result between FM & IWP. I also have another layout with another webviewer taken from a url & that works great, so why not the script?

Any ideas are welcome.

Picture_6.png

Picture_7.png

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

By using this site, you agree to our Terms of Use.