アプリで動画を再生したい。私は周りを見ていますが、何も助けにはなりませんでした。携帯電話の音楽を聴きたいかどうかユーザーに尋ねます。[OK] をクリックすると音楽が再生され続け、そうでない場合は音楽が停止します。それは今から大丈夫です。今、私の問題は次のとおりです。幅と高さなどのポップアップのように使用するグリッドを作成します。このポップアップが表示されると、音楽が停止します。これが、マーケットプレイスでアプリを認定できない理由です。ここに小さなコードがあります:私は理解しやすいと信じています...助けてください!
public void new_grid(int v)
{
Grid gr = new Grid();
gr.Background = new SolidColorBrush(Colors.Cyan);
gr.Opacity = 1.0;
gr.Width = 400;
gr.Height = 600;
// Create a white border.
Border border = new Border();
border.BorderBrush = new SolidColorBrush(Colors.White);
border.BorderThickness = new Thickness(7.0);
MediaElement video_ship = new MediaElement();
//video_ship.AutoPlay = false;
video_ship.Width = 400;
video_ship.Height = 600;
video_ship.VerticalAlignment = VerticalAlignment.Top;
video_ship.HorizontalAlignment = HorizontalAlignment.Left;
if (v == 1)
{
video_ship.Source = new Uri("videos/Lost_Ship.wmv", UriKind.RelativeOrAbsolute);
//video_ship.Play();
gr.Children.Add(video_ship);
}
else if (v == 2)
{
//video_ship.Source = "videos/Lost_Ship.wmv";
video_ship.Source = new Uri("videos/you_are_on_fire.wmv", UriKind.RelativeOrAbsolute);
//video_ship.Name = "fire";
//video_ship.Play();
gr.Children.Add(video_ship);
}
else if (v == 3)
{
//video_ship.SourceName = "videos/Lost_Ship.wmv";
video_ship.Source = new Uri("videos/EscapeShip.wmv", UriKind.RelativeOrAbsolute);
//video_ship.Name = "escape";
//video_ship.Play();
gr.Children.Add(video_ship);
}
変数 v を送信して、動画の 1 つを選択します。動画を Build Action Content に設定します。
何をすべきか?それともこれとは違うものですか?私はビデオを再生したい..ビデオには音楽がありません..または効果音..