wangyixin:我也遇到相同问题
(2020-06-11 13:19)
C# 用免注册方式调用 APlayer 吧,完全不用注册,真正拷贝绿色运行,使用论坛提供的 APlayerCaller.dll 即可, 代码片段如下:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
[DllImport("APlayerCaller.dll", EntryPoint = "APlayer_OpenA")]
public static extern bool APlayer_OpenA(int aplayer, string pszUrl);
[DllImport("APlayerCaller.dll", EntryPoint = "APlayer_Create")]
public static extern int APlayer_Create(
int hParentWnd,
int x,
int y,
int nWidth,
int nHeight,
int OnMessage,
int OnStateChanged,
int OnOpenSuccess,
int OnSeekCompleted,
int OnBuffer,
int OnVideoSizeChanged,
int OnDownloadCodec,
int OnEvent);
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
int hand = this.Handle.ToInt32();
int playhand = APlayer_Create(hand, 10, 10, 500, 500, 0, 0, 0, 0, 0, 0, 0, 0);
string str = "http://aplayer.open.xunlei.com/test.mp4";
APlayer_OpenA(playhand, str);
}
}
}