NetTalk Central

Author Topic: View a video inside a page  (Read 6764 times)

Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
View a video inside a page
« on: July 15, 2009, 06:15:47 AM »
Hi,
In example 26, we can upload images to be seen on the browse and at the right of it (Hotimage websource proc).
We can also upload a video, how can we view that video at the right of the browse?

Thanks
Alberto
-----------
Regards
Alberto

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: View a video inside a page
« Reply #1 on: July 15, 2009, 09:59:49 PM »
Hi Alberto,

You'd need to do some research on HTML to see how to embed video on a web page.

Note although the new standard, HTML 5, has support for a <video> tag, current HTML does not. So you'll need a plugin, like flash, to view the video.

You might want to experiment a bit with displaying you-tube videos on the page, then go from there. 

Cheers
Bruce

Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Re: View a video inside a page
« Reply #2 on: July 17, 2009, 03:18:58 AM »
Bruce,
Doing my research of how to do it I found the following problem.
Always refering to example 26.
In the images browse I´ve added a hyperlink to the image for the user to download the uploaded file, like:
URL:   'ServeDocument?name=' & path() & '\web\' & PIC:FILE   
target frame:   '_blank'
It works ok for an image but when I try to do it with an mpg file the Windows media player opens, show the first video frame and stop, also the time indicator shows 0:00 of 0:00
If I go to the mpg file and double click on it the windows media player opens and reprodcuce the file without problem.

Something I´m doing wrong?
Thanks
Alberto
-----------
Regards
Alberto

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: View a video inside a page
« Reply #3 on: July 17, 2009, 06:39:44 AM »
Hi Alberto,

>> Something I´m doing wrong?

sounds like it, yes. More research would appear to be required....

Cheers
Bruce

Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Re: View a video inside a page
« Reply #4 on: July 17, 2009, 07:01:50 AM »
Yes, I know it, but

Why the NTWS hyperlink does not download the .mpg file?

If I upload a .doc file it behaves ok, asking for run or save de .doc,
If I upload a .jpg image it opens a new page and shows it ok.
If I right click the mouse over the .mpg hyperlink and choose Save as... it is saved ok and if I doble click on it its played ok by windows media.

The problem that made me realized of this, was when I add the following code to the Hotimage websource proc:

     packet = clip(packet) & '<object '
     packet = clip(packet) & ' xml:base="http://127.0.0.1:88" '
     packet = clip(packet) & ' src="'&p_web._MakeUrl(clip(PIC:FILE))&'" '
     packet = clip(packet) & ' type="video/mpeg" '
     packet = clip(packet) & ' width="320" '
     packet = clip(packet) & ' height="240"> '
     packet = clip(packet) & '</object>'

The windows player appears in the page but with the screen black like having nothing to play.


Dont know what else to do.

Thanks
Alberto
« Last Edit: July 17, 2009, 07:13:15 AM by michelis »
-----------
Regards
Alberto

Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Re: View a video inside a page -Quicktime-
« Reply #5 on: July 21, 2009, 09:19:20 AM »
Continuing with my research in viewing videos in xhtml

Only way I could insert the video in the Hotimage websource proc was including an Quicktime object but it works so bad, depending on the file avi, mpg, etc...

'<object height="260" width="320" codebase="http://www.apple.com/qtactivex/qtplugin.cab" classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B">'
'<param value="'&p_web._MakeUrl(clip(PIC:FILE))&'" name="src"/>'
'<param value="true" name="controller"/>'
'<object class="mov" height="260" width="320" data="'&p_web._MakeUrl(clip(PIC:FILE))&'" type="video/quicktime">'
'<param value="true" name="controller"/>'
'You need to install Quicktime video player.'
'</object>'
'</object>'

to be continued...
Alberto
-----------
Regards
Alberto

Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Re: View a video inside a page -Flash-
« Reply #6 on: July 21, 2009, 09:28:11 AM »
The first logic and possible answer:
To convert all the videos the user uploads to flash and use a flash player.

Now, having the .flv flash video file, the only way to view the video in xhtml compatible code is using the following javascript:

    <body>
        <script type="text/javascript" src="swfobject.js"></script>
        <script type="text/javascript">
        function createPlayer() {
            var flashvars = {file:"video.flv", autostart:"true"}
            var params = {allowfullscreen:"true", allowscriptaccess:"always"}
            var attributes = {id:"player1",  name:"player1" }
            swfobject.embedSWF("player.swf", "placeholder1", "320", "196", "9.0.115", false, flashvars, params, attributes); }
        </script>

    </head>
    <body onload="createPlayer();">
            <div id="wrapper">
                <div id="placeholder1"></div>
            </div>
    </body>
    </body>

I can show the .flv file in a separeta window, using a NetWebPage proc but I dont realized how to include this code in the Hotimage websource proc.
Problem is, you have to call a java function (see the body onload)

Any Idea??
Thanks
Alberto
-----------
Regards
Alberto

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: View a video inside a page
« Reply #7 on: July 21, 2009, 11:26:54 PM »
It's a JavaScript function not a Java function.
Java is something completely different.

And you'll always have to support some sort of plugin to do video since HTML doesn't support video as a native type. (HTML 5 may, but that's some way away still.)

Cheers
Bruce

Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Re: View a video inside a page
« Reply #8 on: July 22, 2009, 03:16:01 AM »
Ok Bruce,
May be I was not clear with my question.

In example 26, Browse proc with Hotimage websource proc, is there any way to use that function in the Hotimage proc?
It's easy to include but, how to call it each time I select a browse row?

Thanks
Alberto
-----------
Regards
Alberto

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: View a video inside a page
« Reply #9 on: July 22, 2009, 09:32:13 PM »
You need to add to the "onclick" of the row.
But I want you to figure out how to do it <g>.
It's easy to do - here's a hint -
right-click, choose source, and search for
.cr(

Cheers
Bruce

Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Re: View a video inside a page
« Reply #10 on: July 23, 2009, 06:19:41 AM »
Thanks Bruce,
I found the .cr(
I´ve modified it and in the source code it looks like

<tr onMouseOver="bImages.omv(this);" onMouseOut="bImages.omt(this);"
onclick="bImages.cr(this,'16',0);sv'','hotimage_bimages','refresh=PIC:ID','PIC__ID=16','_ParentProc=bImages','_Silent=0'); createPlayer();">
<td>

createplayer() is what i´ve added but it does not work, it simply does nothing.

I need more help please,
Alberto

-----------
Regards
Alberto

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: View a video inside a page
« Reply #11 on: July 23, 2009, 09:37:44 PM »
presumably you need to specify _what_ to play?

maybe mod your createPlayer function to take a parameter, which you then use in place
of video.flv to specify the file name?

Cheers
Bruce