我创建了一个带有视频播放器的flex应用程序。该应用程序全屏显示。现在我正试图让视频在初始发布时全屏显示。
我曾试图谷歌如何做到这一点,但没有想到什么。这是我的应用代码:
<?xml version="1.0" encoding="utf-8"?>
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
creationComplete="myVid.play();"
applicationComplete="init()"
showStatusBar="false"
xmlns:media="org.osmf.media.*">
<s:VGroup>
<s:VideoDisplay id="myVid"
source="augusta.mp4"
autoPlay="true"
volume="0"
loop="true"
width="100%"
height="100%"
/>
</s:VGroup>
<fx:Script>
<![CDATA[
private function init():void
{
stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE;
}
]]>
</fx:Script>
</s:WindowedApplication>
答案 0 :(得分:0)
使用新调整大小的维度更新容器将是第一步:
public class ListViewOfComicsAdapter extends ArrayAdapter<ComicListItem>
{
Context mContext;
ComicListItem data[] = null;
public ListViewOfComicsAdapter(Context context, int resource, ArrayList<ComicListItem> items)
{
super(context, resource, items);
mContext = context;
try
{
data = new ComicListItem[items.size()];
for (int i = 0; i < items.size(); i++)
data[i] = items.get(i);
}
catch (Exception e)
{
Log.e("problem", "no items to display in framgent");
}
}
@Override
public View getView(int position, View convertView, ViewGroup parent)
{
boolean recycleView = true;
if(convertView == null)
{
// inflate the layout
LayoutInflater inflater = ((Activity) mContext).getLayoutInflater();
convertView = inflater.inflate(R.layout.list_item_comic, parent, false);
recycleView = false;
}
// object item based on the position
ComicListItem objectItem = data[position];
ComicStorageInfo info = new ComicStorageInfo(null, 0, position + 1, 1, objectItem.fileName);
TextView textViewItem = (TextView) convertView.findViewById(R.id.list_item_comic);
textViewItem.setText(objectItem.date);
if(!recycleView)
{
Drawable drawable = new BitmapDrawable(getContext().getResources(), App.getInstance().readImageFromInternalStorage(info.getFileName()));
textViewItem.setCompoundDrawablesWithIntrinsicBounds(null, drawable, null, null);
}
else
{
ProgressBar progressBar = (ProgressBar)convertView.findViewById(R.id.comic_progressbar);
new ReadImageFromStorage(textViewItem, progressBar).execute(info.getFileName());
}
return convertView;
}
}
(请注意,我实际上没有对此进行测试;我没有方便用于测试VideoDisplay组件的视频文件)