public override View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
		{
			// Perform the internal wiring to be able to make use of the BrightcovePlayerFragment.
			View view = inflater.inflate(R.layout.basic_cast_fragment, container, false);
			brightcoveVideoView = (BrightcoveVideoView) view.findViewById(R.id.brightcove_video_view);
			eventEmitter = brightcoveVideoView.EventEmitter;
			base.onCreateView(inflater, container, savedInstanceState);

			// Initialize the android_cast_plugin which requires the application id of your Cast
			// receiver application.
			string applicationId = Resources.getString([email protected]_id);
			googleCastComponent = new GoogleCastComponent(eventEmitter, applicationId, Activity);

			// Initialize the MiniController widget which will allow control of remote media playback.
			miniController = (MiniController) view.findViewById(R.id.miniController1);
			IDictionary<string, object> properties = new Dictionary<string, object>();
			properties[GoogleCastComponent.CAST_MINICONTROLLER] = miniController;
			eventEmitter.emit(GoogleCastEventType.SET_MINI_CONTROLLER, properties);

			// Send the location of the media (url) and its metadata information for remote playback.
			Resources resources = Resources;
			string title = resources.getString([email protected]_title);
			string studio = resources.getString([email protected]_studio);
			string url = resources.getString([email protected]_url);
			string thumbnailUrl = resources.getString([email protected]_thumbnail);
			string imageUrl = resources.getString([email protected]_image);
			eventEmitter.emit(GoogleCastEventType.SET_MEDIA_METADATA, buildMetadataProperties("subTitle", title, studio, thumbnailUrl, imageUrl, url));

			brightcoveVideoView.VideoPath = url;

			return view;
		}
        /// <summary>
        /// Specify where the ad should interrupt the main video.  This code provides a procedural
        /// abastraction for the Google IMA Plugin setup code.
        /// </summary>
        private void setupCuePoints(Source source)
        {
            string cuePointType = "ad";
            IDictionary <string, object> properties = new Dictionary <string, object>();
            IDictionary <string, object> details    = new Dictionary <string, object>();

            // preroll
            CuePoint cuePoint = new CuePoint(CuePoint.PositionType.BEFORE, cuePointType, properties);

            details[Event.CUE_POINT] = cuePoint;
            eventEmitter.emit(EventType.SET_CUE_POINT, details);

            // midroll
            // Due HLS bugs in the Android MediaPlayer, midrolls are not supported.
            if (!source.DeliveryType.Equals(DeliveryType.HLS))
            {
                cuePoint = new CuePoint(10 * (int)DateUtils.SECOND_IN_MILLIS, cuePointType, properties);
                details[Event.CUE_POINT] = cuePoint;
                eventEmitter.emit(EventType.SET_CUE_POINT, details);
            }

            // postroll
            cuePoint = new CuePoint(CuePoint.PositionType.AFTER, cuePointType, properties);
            details[Event.CUE_POINT] = cuePoint;
            eventEmitter.emit(EventType.SET_CUE_POINT, details);
        }
        public EventTest()
        {
            EventEmitter emitter = new EventEmitter();

            emitter.on <Event>("ENTER", (Event e) =>
            {
                Logger.Log(e.ToString());
            });
            emitter.on <MyEvent>(MyEvent.ENTER, (MyEvent e) =>
            {
                Logger.Log(e.ToString());
            });

            emitter.emit <Event>("ENTER", "a", "bc", "hello!!");
            emitter.emit <MyEvent>(MyEvent.ENTER, 1, 2, 3);
        }
Ejemplo n.º 4
0
        public override void onCreateOptionsMenu(Menu menu, MenuInflater inflater)
        {
            Log.v(TAG, "onCreateOptionsMenu");
            inflater.inflate(R.menu.main, menu);
            base.onCreateOptionsMenu(menu, inflater);

            IDictionary <string, object> properties = new Dictionary <string, object>();

            properties[GoogleCastComponent.CAST_MENU]             = menu;
            properties[GoogleCastComponent.CAST_MENU_RESOURCE_ID] = R.id.media_router_menu_item;
            eventEmitter.emit(GoogleCastEventType.SET_CAST_BUTTON, properties);
        }
Ejemplo n.º 5
0
        public override View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            // Perform the internal wiring to be able to make use of the BrightcovePlayerFragment.
            View view = inflater.inflate(R.layout.basic_cast_fragment, container, false);

            brightcoveVideoView = (BrightcoveVideoView)view.findViewById(R.id.brightcove_video_view);
            eventEmitter        = brightcoveVideoView.EventEmitter;
            base.onCreateView(inflater, container, savedInstanceState);

            // Initialize the android_cast_plugin which requires the application id of your Cast
            // receiver application.
            string applicationId = Resources.getString([email protected]_id);

            googleCastComponent = new GoogleCastComponent(eventEmitter, applicationId, Activity);

            // Initialize the MiniController widget which will allow control of remote media playback.
            miniController = (MiniController)view.findViewById(R.id.miniController1);
            IDictionary <string, object> properties = new Dictionary <string, object>();

            properties[GoogleCastComponent.CAST_MINICONTROLLER] = miniController;
            eventEmitter.emit(GoogleCastEventType.SET_MINI_CONTROLLER, properties);

            // Send the location of the media (url) and its metadata information for remote playback.
            Resources resources    = Resources;
            string    title        = resources.getString([email protected]_title);
            string    studio       = resources.getString([email protected]_studio);
            string    url          = resources.getString([email protected]_url);
            string    thumbnailUrl = resources.getString([email protected]_thumbnail);
            string    imageUrl     = resources.getString([email protected]_image);

            eventEmitter.emit(GoogleCastEventType.SET_MEDIA_METADATA, buildMetadataProperties("subTitle", title, studio, thumbnailUrl, imageUrl, url));

            brightcoveVideoView.VideoPath = url;

            return(view);
        }