Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Yousfi Benameur
  Where is Yousfi Benameur?
 El Bayadh
 Algeria
 Yousfi Benameur
 To: JLW Smith
  Where is JLW Smith?
 
 United Kingdom
 JLW Smith
 Tags
Subject: RE: Web browser in form
Thread ID: 208939 Message ID: 209368 # Views: 3 # Ratings: 0
Version: Visual FoxPro 8 Category: Web, FTP and other Internet Protocols
Date: Saturday, December 27, 2008 11:41:44 PM         
   


> The URL opens a full page, example:
>
> http://uk.youtube.com/watch?v=7Deyox7GCzs
>
> However the embed code (can be found below the URL link on the page above, titled "Embed") would just open the movie in a specified size in a page, which is what I am after, but for a form...
>
> ]
>
>
> Many Thanks

Hi JLW
Generally the video url is not show in the page web brodcasted. it is hidden in some server and we cannot access to it.
but in certain cases can find the url in the html object of the page (rightclic on the page web and see the code source...you can scan all words http://....maybe you find the url of the video-sometimes it be found in an object tag(media player,flash player..)).
In youtube all valid video URl may be like :
http://www.youtube.com/watch?v=1eKifSDgU48
you can search in the page web script(right clic) the word like: "http://www.youtube.com/watch?v="
that can be done programmatly with iexplore,innerhtml,atc...


in other cases youtube gives the name of the page and the code html embeding the movie: here we can find the url adress of the
video.Take it and play it on a form browser.This is a video player ,(you can right clic on the textbox and paste the url)
this player is resizable.paste a valid url of a video (directly instead uRl of a web page)
Local oForm
oForm = Createobject('TestForm')
oForm.Show
read events
Return

Define Class TestForm As Form
	Height = 600
	Width = 800
	showwindow=2
	autocenter=.t.
	showtips=.t.
	caption="Youtube video viewer "
    name="form1"
    
	add object text1 as textbox with left=20,width=350,top=290,selectOnEntry=.t.,tooltiptext="Rightclic to paste an Url",name="text1"
	add object command1 as commandbutton with caption="Go!",left= 330,width=27,top=290,name="command1"
	add object OleCont as OleControl with oleclass="Shell.Explorer.2",left=20,top=10,width=410,height=270,visible=.t.,name="olecont"
    
  procedure resize
  this resize()
  endproc

	procedure text1.init
	this.value="http://www.youtube.com/v/WcnRUGKX9Hg&rel=0&autoplay=1"
	endproc
	
	procedure text1.rightclick
	this.value=_cliptext
	endproc
	
	procedure command1.click
	thisForm.OleCont.Navigate(thisform.text1.value)     
	endproc
	
	procedure resize
	this.olecont.left=1
	this.olecont.top=1
	this.olecont.width=this.width-2
	this.olecont.height=this.height-this.command1.height-6
	this.text1.left=1
	this.command1.top=this.height-this.command1.height-5
	this.text1.top=this.command1.top
	this.command1.left=this.text1.left+this.text1.width+2
	procedure destroy
	clea events
	endproc
Enddefine


if you want to find an url of youtube video in a web page this is a code
set safe off
cr=chr(13)
    
xURL=" http://uk.youtube.com/watch?v=7Deyox7GCzs"
apIE=createObject("internetexplorer.application")
apIE.navigate(xURl)
apIE.visible=.f.
do while apIE.busy or apIE.readystate#4
enddo
inkey(1)
***********************************
xhtml=apIE.document.body.innerhtml
apIE.quit
messagebox(xhtml)

ystr="http://www.youtube.com/"

aa=""
pos=1
n=1
do while pos>0
pos=atc(ystr,xhtml,n)
aa=aa+trans(n)+"-   "+substr(xhtml,pos,100)+chr(13)+chr(10)
n=n+1
enddo
if n>1
aa=aa+substr(xhtml,atc(xhtml,ystr,n),100)  &&100 characters
endi
aa=aa+chr(13)+chr(10)

=strtofile(aa,"c:\myUrl.txt")
set safe on

run/n "notepad" c:\myUrl.txt

you can search in the words retrieved what is the valid youtube url
Regards

ENTIRE THREAD

Web browser in form Posted by JLW Smith @ 12/22/2008 10:14:47 PM
RE: Web browser in form Posted by Glenn Villar @ 12/23/2008 2:17:22 AM
RE: Web browser in form Posted by Yousfi Benameur @ 12/23/2008 2:49:19 AM
RE: Web browser in form Posted by JLW Smith @ 12/23/2008 9:13:07 AM
RE: Web browser in form Posted by Yousfi Benameur @ 12/23/2008 2:15:21 PM
RE: Web browser in form Posted by JLW Smith @ 12/23/2008 4:24:37 PM
RE: Web browser in form Posted by Yousfi Benameur @ 12/23/2008 5:20:12 PM
RE: Web browser in form Posted by JLW Smith @ 12/26/2008 10:57:50 PM
RE: Web browser in form Posted by Yousfi Benameur @ 12/27/2008 12:40:40 AM
RE: Web browser in form Posted by JLW Smith @ 12/27/2008 5:56:11 PM
RE: Web browser in form Posted by Yousfi Benameur @ 12/27/2008 11:41:44 PM