5 Replies - 6704 Views - Last Post: 25 September 2009 - 12:45 AM Rate Topic: -----

#1 asadkhanno1   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 14
  • Joined: 16-September 08

play video from website using Microsoft.DirectX.AudioVideoPlayback

Posted 09 September 2009 - 01:55 PM

hello i ve tried play video from hard disk work fine but i want to play video from web video (.wmv) plzz help me whats the mistake in code ii bet from my freind that i do this plzz help its urgent
code is:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Web;
using System.Windows.Forms;
using Microsoft.DirectX.AudioVideoPlayback;

namespace directxvideoplayer 
{
public partial class Form1 : Form
{
public Form1() 
{
InitializeComponent();
}

private void Form1_Load(object sender, EventArgs e) 
{
int width = panel1.Width; 
int height = panel1.Height; 
System.Uri u = new Uri("http://www.livevideo.com/video/09C9EEDA03EF4B55A6D16E2F7CF0B638/prezentacja-zespolu-f1-honda-t.aspx"); 

Video video; 
video= Video.FromUrl(u); 
video.Owner = panel1;
video.Stop();
video.Play();

// resize the video to the size original size of the panel

panel1.Size = new Size(width, height); 
}
}
}



Admin Edit: Please use code tags when posting your code. Code tags are used like so => :code:

Thanks,
PsychoCoder :)

Is This A Good Question/Topic? 0
  • +

Replies To: play video from website using Microsoft.DirectX.AudioVideoPlayback

#2 PsychoCoder   User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1659
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: play video from website using Microsoft.DirectX.AudioVideoPlayback

Posted 09 September 2009 - 02:08 PM

Are you receiving any errors? Does this code not work that way you intended it? When asking for help there are a couple items that are vital in order for someone to properly help you:

  • Post the code you're having problems with (DONE)
  • Post the exact error you're receiving, if you are receiving one
  • If no error explain what the code is doing versus what you want it to do
  • Post your question in the body of your post, not the description field


Also, I can just about tell from the way the code looked when you posted it (I made it a little easier to read) it was copied from a web page somewhere and that you didn't write it :)
Was This Post Helpful? 0
  • +
  • -

#3 JackOfAllTrades   User is offline

  • Saucy!
  • member icon

Reputation: 6246
  • View blog
  • Posts: 24,014
  • Joined: 23-August 08

Re: play video from website using Microsoft.DirectX.AudioVideoPlayback

Posted 09 September 2009 - 02:30 PM

You are giving a URI to a web page, not a URI to a video resource.
Was This Post Helpful? 0
  • +
  • -

#4 asadkhanno1   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 14
  • Joined: 16-September 08

Re: play video from website using Microsoft.DirectX.AudioVideoPlayback

Posted 09 September 2009 - 09:56 PM

View PostJackOfAllTrades, on 9 Sep, 2009 - 01:30 PM, said:

You are giving a URI to a web page, not a URI to a video resource.

yes so bro. how do i give uri to a video resource i m trying but i cant figure it out
its another overloaded function is
Video video;
video= Video.FromFile("c:\\my.mpg");
its work fine but how do i use this function
video=Video.FromUri("http:// bla bla");
mention the code plzzz or link i have only two days for submit this in my semister lab plzz helpppp

This post has been edited by asadkhanno1: 09 September 2009 - 10:16 PM

Was This Post Helpful? 0
  • +
  • -

#5 JackOfAllTrades   User is offline

  • Saucy!
  • member icon

Reputation: 6246
  • View blog
  • Posts: 24,014
  • Joined: 23-August 08

Re: play video from website using Microsoft.DirectX.AudioVideoPlayback

Posted 10 September 2009 - 07:33 AM

That web site plays its videos through an embedded player, so there's no direct way to get the URL for that video. I would suggest finding another site.
Was This Post Helpful? 0
  • +
  • -

#6 april198474   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 13
  • Joined: 17-September 09

Re: play video from website using Microsoft.DirectX.AudioVideoPlayback

Posted 25 September 2009 - 12:45 AM

Yes, You are giving a URI to a web page, not a URI to a video resource

---------------------------------
April
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1